diff options
| author | Xinhui | 2016-11-28 13:25:18 +0100 |
|---|---|---|
| committer | Xinhui | 2016-11-28 13:25:18 +0100 |
| commit | 850061c7f1d20bce0cf9163658327fc3557919bc (patch) | |
| tree | e86cd9bf156312b4e3df5bb7b2ce7ac93d070258 /app/controllers | |
| parent | 61653806b8d977eef4d565040cc7ea86cb9fa9c9 (diff) | |
| download | chouette-core-850061c7f1d20bce0cf9163658327fc3557919bc.tar.bz2 | |
LineFootnotes#show
Diffstat (limited to 'app/controllers')
| -rw-r--r-- | app/controllers/line_footnotes_controller.rb | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/app/controllers/line_footnotes_controller.rb b/app/controllers/line_footnotes_controller.rb index 6e3c08653..305a8fac3 100644 --- a/app/controllers/line_footnotes_controller.rb +++ b/app/controllers/line_footnotes_controller.rb @@ -1,16 +1,23 @@ class LineFootnotesController < ChouetteController - before_action :set_line + defaults :resource_class => Chouette::Line, :instance_name => 'line' before_action :check_policy, :only => [:edit, :update] + belongs_to :referential def show + show! do + build_breadcrumb :show + end end def edit + edit! do + build_breadcrumb :edit + end end def update if @line.update(line_params) - redirect_to referential_line_path(@referential, @line) , notice: t('notice.footnotes.updated') + redirect_to referential_line_footnotes_path(@referential, @line) , notice: t('notice.footnotes.updated') else render :edit end @@ -18,10 +25,10 @@ class LineFootnotesController < ChouetteController private def check_policy - authorize @line, :update_footnote? + authorize resource, :update_footnote? end - def set_line + def resource @referential = Referential.find params[:referential_id] @line = @referential.lines.find params[:line_id] end |
