Class: SeriesStatementMergesController

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

Instance Method Summary collapse

Instance Method Details

#createObject

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

#destroyObject

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

#editObject

GET /series_statement_merges/1/edit



45
46
# File 'app/controllers/series_statement_merges_controller.rb', line 45

def edit
end

#indexObject

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

#newObject

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

#showObject

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

#updateObject

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