Class: SeriesController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- SeriesController
- Defined in:
- app/controllers/series_controller.rb
Instance Method Summary collapse
- #create ⇒ Object
- #destroy ⇒ Object
- #edit ⇒ Object
- #index ⇒ Object
- #new ⇒ Object
- #show ⇒ Object
- #update ⇒ Object
Instance Method Details
#create ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 |
# File 'app/controllers/series_controller.rb', line 19 def create @series = Series.new(series_params) @series.report = @report respond_to do |format| if @series.save format.html { redirect_to report_series_index_url, notice: '添加成功' } else format.html { render :new } end end end |
#destroy ⇒ Object
41 42 43 44 45 46 |
# File 'app/controllers/series_controller.rb', line 41 def destroy @series.destroy respond_to do |format| format.html { redirect_to report_series_index_url, notice: '删除成功' } end end |
#edit ⇒ Object
16 17 |
# File 'app/controllers/series_controller.rb', line 16 def edit end |
#index ⇒ Object
5 6 7 |
# File 'app/controllers/series_controller.rb', line 5 def index @series = @report.series end |
#new ⇒ Object
12 13 14 |
# File 'app/controllers/series_controller.rb', line 12 def new @series = Series.new end |
#show ⇒ Object
9 10 |
# File 'app/controllers/series_controller.rb', line 9 def show end |
#update ⇒ Object
31 32 33 34 35 36 37 38 39 |
# File 'app/controllers/series_controller.rb', line 31 def update respond_to do |format| if @series.update(series_params) format.html { redirect_to report_series_index_url, notice: '修改成功' } else format.html { render :edit } end end end |