diff options
author | Peter Kozak <spag@golwen.net> | 2013-04-26 12:25:20 +0200 |
---|---|---|
committer | Peter Kozak <spag@golwen.net> | 2013-04-26 12:25:20 +0200 |
commit | eea29ec6d3e9658e9f9424e4d1e4f278f438630a (patch) | |
tree | 0c0b6baca974572f8120599223e1bcb5d1592ab4 /app/controllers | |
parent | a94fafb695e19715505e05ab71034b14d7bde8c1 (diff) |
breadcrumbs
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/gateway_settings_controller.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/app/controllers/gateway_settings_controller.rb b/app/controllers/gateway_settings_controller.rb index 0304411..0fecdaf 100644 --- a/app/controllers/gateway_settings_controller.rb +++ b/app/controllers/gateway_settings_controller.rb @@ -2,6 +2,8 @@ class GatewaySettingsController < ApplicationController load_and_authorize_resource :gateway load_and_authorize_resource :gateway_setting, :through => [:gateway] + before_filter :spread_breadcrumbs + def index @gateway_settings = @gateway.gateway_settings end @@ -41,4 +43,15 @@ class GatewaySettingsController < ApplicationController @gateway_setting.destroy redirect_to gateway_path(@gateway), :notice => t('gateway_settings.controller.successfuly_destroyed') end + + private + def spread_breadcrumbs + add_breadcrumb t("gateways.index.page_title"), gateways_path + add_breadcrumb @gateway, @gateway + add_breadcrumb t("gateway_settings.index.page_title"), gateway_gateway_settings_url(@gateway) + + if @gateway_setting && !@gateway_setting.new_record? + add_breadcrumb @gateway_setting + end + end end |