Sha256: 853b37aca1792fd2df2b6d06daa913f8d8507048fd85be5a13a1e8d327ad48aa

Contents?: true

Size: 1.48 KB

Versions: 2

Compression:

Stored size: 1.48 KB

Contents

# Include
require 'rubygems'
require 'active_support'
require 'rails_breadcrumbs/model_additions'
require 'rails_breadcrumbs/controller_additions'
require 'rails_breadcrumbs/view_additions'

# = Rails breadcrumbs
#
module RailsBreadcrumbs
  # ::Rails.logger.error("...")

  # default options that can be overridden on the global level
  @@options = {
      :locale_root              => 'navigation.breadcrumbs.', #
      :home_path                => '/welcome',                #
      :home_label               => 'Home',                    #
      :item_separator           => ' >',                   #
      :css_class                => 'breadcrumbs',             #
      :fist_item_css_class      => 'first_breadcrumb_item',   #
      :last_item_css_class      => 'last_breadcrumb_item',    #
      :make_last_item_as_link   => true,                      #
      :include_home_icon        => true,                      #
      :include_home_label       => false,                      #
  }
  mattr_reader :options


  def self.enable_activerecord
    ActiveRecord::Base.send :include, RailsBreadcrumbs::ModelAdditions
  end

  def self.enable_actionpack
    ActionController::Base.send :include, RailsBreadcrumbs::ControllerAdditions

    ActionView::Base.send :include, RailsBreadcrumbs::ViewAdditions
  end
end

if defined? Rails
  RailsBreadcrumbs.enable_activerecord if defined? ActiveRecord
  RailsBreadcrumbs.enable_actionpack if defined? ActionController
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rails_breadcrumbs-0.5.4 lib/rails_breadcrumbs.rb
rails_breadcrumbs-0.5.3 lib/rails_breadcrumbs.rb