Sha256: dac63a8b0375e934559e02732c788b024b772ae1567eead2cea81abd323e9d3b

Contents?: true

Size: 723 Bytes

Versions: 37

Compression:

Stored size: 723 Bytes

Contents

module ShelvesHelper
  def library_shelf_facet(current_library, facet)
    library = Library.where(:name => facet.value).select([:name, :display_name]).first
    return nil unless library
    string = ''
    current = true if current_library.try(:name) == library.name
    content_tag :li do
      if current
        content_tag :strong do
          link_to("#{library.display_name.localize} (" + facet.count.to_s + ")", url_for(params.merge(:page => nil, :library_id => library.name, :only_path => true)))
        end
      else
        link_to("#{library.display_name.localize} (" + facet.count.to_s + ")", url_for(params.merge(:page => nil, :library_id => library.name, :only_path => true)))
      end
    end
  end
end

Version data entries

37 entries across 37 versions & 1 rubygems

Version Path
enju_library-0.1.0.pre16 app/helpers/shelves_helper.rb
enju_library-0.1.0.pre15 app/helpers/shelves_helper.rb
enju_library-0.1.0.pre14 app/helpers/shelves_helper.rb
enju_library-0.1.0.pre13 app/helpers/shelves_helper.rb
enju_library-0.1.0.pre12 app/helpers/shelves_helper.rb
enju_library-0.1.0.pre11 app/helpers/shelves_helper.rb
enju_library-0.1.0.pre10 app/helpers/shelves_helper.rb
enju_library-0.1.0.pre9 app/helpers/shelves_helper.rb
enju_library-0.1.0.pre8 app/helpers/shelves_helper.rb
enju_library-0.1.0.pre7 app/helpers/shelves_helper.rb
enju_library-0.1.0.pre6 app/helpers/shelves_helper.rb
enju_library-0.1.0.pre5 app/helpers/shelves_helper.rb
enju_library-0.1.0.pre4 app/helpers/shelves_helper.rb
enju_library-0.1.0.pre3 app/helpers/shelves_helper.rb
enju_library-0.1.0.pre2 app/helpers/shelves_helper.rb
enju_library-0.1.0.pre app/helpers/shelves_helper.rb
enju_library-0.0.2 app/helpers/shelves_helper.rb