Module: Crumby::Helper::ControllerHelper
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/crumby/helper/controller.rb
Overview
controller helper
Instance Method Summary collapse
-
#add_crumby(*args) ⇒ Object
render trail.
-
#crumby_title(*args) ⇒ Object
render trail.
-
#crumby_trail(scope = :default) ⇒ Object
return crumby_trail by scope.
Instance Method Details
#crumby(options) ⇒ Object #crumby(scope, options) ⇒ Object
render trail
31 32 33 34 35 |
# File 'lib/crumby/helper/controller.rb', line 31 def add_crumby(*args) = args. scope = .delete(:scope) || :default crumby_trail(scope).add(*args, ) end |
#crumby(options) ⇒ Object #crumby(suffix, options) ⇒ Object
render trail
47 48 49 50 51 |
# File 'lib/crumby/helper/controller.rb', line 47 def crumby_title(*args) = args. scope = .delete(:scope) || :default crumby_trail(scope).title(*args, ) end |
#crumby_trail(scope = :default) ⇒ Object
return crumby_trail by scope
14 15 16 17 18 19 |
# File 'lib/crumby/helper/controller.rb', line 14 def crumby_trail(scope = :default) raise ArgumentError if scope.nil? scope = scope.to_sym @crumby_trails = {} if @crumby_trails.nil? @crumby_trails[scope] ||= Crumby::Trail.new end |