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



51
52
53
54
55
56
57
58
59
60
61
62
63
64
# File 'app/controllers/series_statement_merges_controller.rb', line 51

def create
  @series_statement_merge = SeriesStatementMerge.new(series_statement_merge_params)

  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



83
84
85
86
87
88
89
90
# File 'app/controllers/series_statement_merges_controller.rb', line 83

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



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

def edit
end

#indexObject

GET /series_statement_merges GET /series_statement_merges.json



8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'app/controllers/series_statement_merges_controller.rb', line 8

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



34
35
36
37
38
39
40
41
42
43
# File 'app/controllers/series_statement_merges_controller.rb', line 34

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



25
26
27
28
29
30
# File 'app/controllers/series_statement_merges_controller.rb', line 25

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



68
69
70
71
72
73
74
75
76
77
78
79
# File 'app/controllers/series_statement_merges_controller.rb', line 68

def update
  respond_to do |format|
    if @series_statement_merge.update(series_statement_merge_params)
      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