Sha256: 60406846f2497289983e13729fcc87e204e793d4d92039eef40619ccbaa8f513

Contents?: true

Size: 772 Bytes

Versions: 10

Compression:

Stored size: 772 Bytes

Contents

module Twitter
  module Bootstrap
    module BreadCrumbs
      def self.included(base)
        base.extend(ClassMethods)
      end

      module ClassMethods
        def add_breadcrumb name, url, options={}
          before_filter options do |controller|
            controller.send :add_breadcrumb, name, url
          end
        end
      end

      protected

      def add_breadcrumb name, url = '', options = {}
        @breadcrumbs ||= []
        url = eval(url.to_s) if url =~ /_path|_url|@/
          @breadcrumbs << {:name => name, :url => url, :options => options}
      end

      def render_breadcrumbs(divider = '/')
        s = render :partial => 'twitter-bootstrap/breadcrumbs', :locals => {:divider => divider}
        s.first
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 4 rubygems

Version Path
twitter-bootstrap-rails-2.1.7 lib/twitter/bootstrap/rails/twitter-bootstrap-breadcrumbs.rb
rbootstrap-1.1.2 lib/twitter/bootstrap/rails/twitter-bootstrap-breadcrumbs.rb
twitter-bootstrap-rails-2.1.6 lib/twitter/bootstrap/rails/twitter-bootstrap-breadcrumbs.rb
twitter-bootstrap-rails-2.1.5 lib/twitter/bootstrap/rails/twitter-bootstrap-breadcrumbs.rb
twitter-bootstrap-rails-2.1.4 lib/twitter/bootstrap/rails/twitter-bootstrap-breadcrumbs.rb
twitter-bootstrap-turbo-2.1.3 lib/twitter/bootstrap/rails/twitter-bootstrap-breadcrumbs.rb
cf-twitter-bootstrap-rails-2.1.3 lib/twitter/bootstrap/rails/twitter-bootstrap-breadcrumbs.rb
twitter-bootstrap-rails-2.1.3 lib/twitter/bootstrap/rails/twitter-bootstrap-breadcrumbs.rb
twitter-bootstrap-rails-2.1.2 lib/twitter/bootstrap/rails/twitter-bootstrap-breadcrumbs.rb
twitter-bootstrap-rails-2.1.1 lib/twitter/bootstrap/rails/twitter-bootstrap-breadcrumbs.rb