diff options
author | Peter Kozak <spag@golwen.net> | 2013-04-26 12:25:27 +0200 |
---|---|---|
committer | Peter Kozak <spag@golwen.net> | 2013-04-26 12:25:27 +0200 |
commit | 0c545798470f64923db9b37b8abac96684c739eb (patch) | |
tree | 5f9aeb75ac563db226d19498ead3b3d6662ddd2b | |
parent | eea29ec6d3e9658e9f9424e4d1e4f278f438630a (diff) |
breadcrumbs
-rw-r--r-- | app/controllers/gateway_parameters_controller.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/app/controllers/gateway_parameters_controller.rb b/app/controllers/gateway_parameters_controller.rb index d5ade9e..693a484 100644 --- a/app/controllers/gateway_parameters_controller.rb +++ b/app/controllers/gateway_parameters_controller.rb @@ -2,6 +2,8 @@ class GatewayParametersController < ApplicationController load_and_authorize_resource :gateway load_and_authorize_resource :gateway_parameter, :through => [:gateway] + before_filter :spread_breadcrumbs + def index @gateway_parameters = @gateway.gateway_parameters end @@ -41,4 +43,15 @@ class GatewayParametersController < ApplicationController @gateway_parameter.destroy redirect_to gateway_path(@gateway), :notice => t('gateway_parameters.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_parameters.index.page_title"), gateway_gateway_parameters_url(@gateway) + + if @gateway_parameter && !@gateway_parameter.new_record? + add_breadcrumb @gateway_parameter + end + end end |