summaryrefslogtreecommitdiff
path: root/app/controllers/gs_parameters_controller.rb
diff options
context:
space:
mode:
authorStefan Wintermeyer <stefan.wintermeyer@amooma.de>2013-01-15 20:44:45 +0100
committerStefan Wintermeyer <stefan.wintermeyer@amooma.de>2013-01-15 20:44:45 +0100
commitfefbc85c45fdb3b8353fc9011ef74010242b73d4 (patch)
tree7b24d6792d946d8327570a9212a0f7c121192fed /app/controllers/gs_parameters_controller.rb
parent4fbda07c7b593dcc22b90f571d1b85b1bdc47528 (diff)
parent907d081bf1b45e876f9d5833bfe1f4d6319aeb81 (diff)
Merge branch 'fix_breadcrumbs' into develop
Diffstat (limited to 'app/controllers/gs_parameters_controller.rb')
-rw-r--r--app/controllers/gs_parameters_controller.rb13
1 files changed, 12 insertions, 1 deletions
diff --git a/app/controllers/gs_parameters_controller.rb b/app/controllers/gs_parameters_controller.rb
index a7813dc..7ca4e8e 100644
--- a/app/controllers/gs_parameters_controller.rb
+++ b/app/controllers/gs_parameters_controller.rb
@@ -1,6 +1,10 @@
class GsParametersController < ApplicationController
+ load_resource :gs_parameter
+
+ before_filter :spread_breadcrumbs
+
def index
- @ps_parameters_unordered = GsParameter.scoped
+ @gs_parameters_unordered = GsParameter.scoped
@gs_parameters = GsParameter.order([:section, :name])
@sections = @gs_parameters.pluck(:section).uniq.sort
end
@@ -30,4 +34,11 @@ class GsParametersController < ApplicationController
def gs_parameter_params
params.require(:gs_parameter).permit(:value, :class_type, :description)
end
+
+ def spread_breadcrumbs
+ add_breadcrumb t("gs_parameters.index.page_title"), gs_parameters_path
+ if @gs_parameter && !@gs_parameter.new_record?
+ add_breadcrumb @gs_parameter, gs_parameter_path(@gs_parameter)
+ end
+ end
end