Module: BootstrapSassExtras::BreadCrumbs::ClassMethods

Defined in:
lib/bootstrap-sass-extras/breadcrumbs.rb

Instance Method Summary collapse

Instance Method Details

#add_breadcrumb(name, url, options = {}) ⇒ Object



11
12
13
14
15
16
17
18
19
# File 'lib/bootstrap-sass-extras/breadcrumbs.rb', line 11

def add_breadcrumb(name, url, options = {})
  class_name = self.name
  before_action options do |controller|
    if name.is_a?(Symbol)
      name = controller.send :translate_breadcrumb, name, class_name
    end
    controller.send :add_breadcrumb, name, url
  end
end