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