Class: PatronMergesController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- PatronMergesController
- Defined in:
- app/controllers/patron_merges_controller.rb
Instance Method Summary collapse
-
#create ⇒ Object
POST /patron_merges POST /patron_merges.json.
-
#destroy ⇒ Object
DELETE /patron_merges/1 DELETE /patron_merges/1.json.
-
#edit ⇒ Object
GET /patron_merges/1/edit.
-
#index ⇒ Object
GET /patron_merges GET /patron_merges.json.
-
#new ⇒ Object
GET /patron_merges/new GET /patron_merges/new.json.
-
#show ⇒ Object
GET /patron_merges/1 GET /patron_merges/1.json.
-
#update ⇒ Object
PUT /patron_merges/1 PUT /patron_merges/1.json.
Instance Method Details
#create ⇒ Object
POST /patron_merges POST /patron_merges.json
49 50 51 52 53 54 55 56 57 58 59 60 61 |
# File 'app/controllers/patron_merges_controller.rb', line 49 def create @patron_merge = PatronMerge.new(params[:patron_merge]) respond_to do |format| if @patron_merge.save format.html { redirect_to(@patron_merge, :notice => t('controller.successfully_created', :model => t('activerecord.models.patron_merge'))) } format.json { render :json => @patron_merge, :status => :created, :location => @patron_merge } else format.html { render :action => "new" } format.json { render :json => @patron_merge.errors, :status => :unprocessable_entity } end end end |
#destroy ⇒ Object
DELETE /patron_merges/1 DELETE /patron_merges/1.json
79 80 81 82 83 84 85 86 |
# File 'app/controllers/patron_merges_controller.rb', line 79 def destroy @patron_merge.destroy respond_to do |format| format.html { redirect_to(patron_merges_url) } format.json { head :no_content } end end |
#edit ⇒ Object
GET /patron_merges/1/edit
44 45 |
# File 'app/controllers/patron_merges_controller.rb', line 44 def edit end |
#index ⇒ Object
GET /patron_merges GET /patron_merges.json
7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'app/controllers/patron_merges_controller.rb', line 7 def index if @patron @patron_merges = @patron.patron_merges.order('patron_merges.id').page(params[:page]) elsif @patron_merge_list @patron_merges = @patron_merge_list.patron_merges.order('patron_merges.id').includes(:patron).page(params[:page]) else @patron_merges = PatronMerge.page(params[:page]) end respond_to do |format| format.html # index.html.erb format.json { render :json => @patron_merges } end end |
#new ⇒ Object
GET /patron_merges/new GET /patron_merges/new.json
33 34 35 36 37 38 39 40 41 |
# File 'app/controllers/patron_merges_controller.rb', line 33 def new @patron_merge = PatronMerge.new @patron_merge.patron = @patron respond_to do |format| format.html # new.html.erb format.json { render :json => @patron_merge } end end |
#show ⇒ Object
GET /patron_merges/1 GET /patron_merges/1.json
24 25 26 27 28 29 |
# File 'app/controllers/patron_merges_controller.rb', line 24 def show respond_to do |format| format.html # show.html.erb format.json { render :json => @patron_merge } end end |
#update ⇒ Object
PUT /patron_merges/1 PUT /patron_merges/1.json
65 66 67 68 69 70 71 72 73 74 75 |
# File 'app/controllers/patron_merges_controller.rb', line 65 def update respond_to do |format| if @patron_merge.update_attributes(params[:patron_merge]) format.html { redirect_to(@patron_merge, :notice => t('controller.successfully_updated', :model => t('activerecord.models.patron_merge'))) } format.json { head :no_content } else format.html { render :action => "edit" } format.json { render :json => @patron_merge.errors, :status => :unprocessable_entity } end end end |