Class: SubjectHeadingTypeHasSubjectsController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/subject_heading_type_has_subjects_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject

POST /subject_heading_type_has_subjects POST /subject_heading_type_has_subjects.json



42
43
44
45
46
47
48
49
50
51
52
53
54
# File 'app/controllers/subject_heading_type_has_subjects_controller.rb', line 42

def create
  @subject_heading_type_has_subject = SubjectHeadingTypeHasSubject.new(params[:subject_heading_type_has_subject])

  respond_to do |format|
    if @subject_heading_type_has_subject.save
      format.html { redirect_to @subject_heading_type_has_subject, :notice => 'SubjectHeadingTypeHasSubject was successfully created.' }
      format.json { render :json => @subject_heading_type_has_subject, :status => :created, :location => @subject_heading_type_has_subject }
    else
      format.html { render :action => "new" }
      format.json { render :json => @subject_heading_type_has_subject.errors, :status => :unprocessable_entity }
    end
  end
end

#destroyObject

DELETE /subject_heading_type_has_subjects/1 DELETE /subject_heading_type_has_subjects/1.json



72
73
74
75
76
77
78
79
# File 'app/controllers/subject_heading_type_has_subjects_controller.rb', line 72

def destroy
  @subject_heading_type_has_subject.destroy

  respond_to do |format|
    format.html { redirect_to subject_heading_type_has_subjects_url }
    format.json { head :no_content }
  end
end

#editObject

GET /subject_heading_type_has_subjects/1/edit



37
38
# File 'app/controllers/subject_heading_type_has_subjects_controller.rb', line 37

def edit
end

#indexObject

GET /subject_heading_type_has_subjects GET /subject_heading_type_has_subjects.json



7
8
9
10
11
12
13
14
# File 'app/controllers/subject_heading_type_has_subjects_controller.rb', line 7

def index
  @subject_heading_type_has_subjects = SubjectHeadingTypeHasSubject.page(params[:page])

  respond_to do |format|
    format.html # index.html.erb
    format.json { render :json => @subject_heading_type_has_subjects }
  end
end

#newObject

GET /subject_heading_type_has_subjects/new GET /subject_heading_type_has_subjects/new.json



27
28
29
30
31
32
33
34
# File 'app/controllers/subject_heading_type_has_subjects_controller.rb', line 27

def new
  @subject_heading_type_has_subject = SubjectHeadingTypeHasSubject.new

  respond_to do |format|
    format.html # new.html.erb
    format.json { render :json => @subject_heading_type_has_subject }
  end
end

#showObject

GET /subject_heading_type_has_subjects/1 GET /subject_heading_type_has_subjects/1.json



18
19
20
21
22
23
# File 'app/controllers/subject_heading_type_has_subjects_controller.rb', line 18

def show
  respond_to do |format|
    format.html # show.html.erb
    format.json { render :json => @subject_heading_type_has_subject }
  end
end

#updateObject

PUT /subject_heading_type_has_subjects/1 PUT /subject_heading_type_has_subjects/1.json



58
59
60
61
62
63
64
65
66
67
68
# File 'app/controllers/subject_heading_type_has_subjects_controller.rb', line 58

def update
  respond_to do |format|
    if @subject_heading_type_has_subject.update_attributes(params[:subject_heading_type_has_subject])
      format.html { redirect_to @subject_heading_type_has_subject, :notice => 'SubjectHeadingTypeHasSubject was successfully updated.' }
      format.json { head :no_content }
    else
      format.html { render :action => "edit" }
      format.json { render :json => @subject_heading_type_has_subject.errors, :status => :unprocessable_entity }
    end
  end
end