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.pre36 app/helpers/shelves_helper.rb
enju_library-0.1.0.pre35 app/helpers/shelves_helper.rb
enju_library-0.1.0.pre34 app/helpers/shelves_helper.rb
enju_library-0.1.0.pre33 app/helpers/shelves_helper.rb
enju_library-0.1.0.pre32 app/helpers/shelves_helper.rb
enju_library-0.1.0.pre31 app/helpers/shelves_helper.rb
enju_library-0.1.0.pre30 app/helpers/shelves_helper.rb
enju_library-0.1.0.pre29 app/helpers/shelves_helper.rb
enju_library-0.1.0.pre28 app/helpers/shelves_helper.rb
enju_library-0.1.0.pre27 app/helpers/shelves_helper.rb
enju_library-0.1.0.pre26 app/helpers/shelves_helper.rb
enju_library-0.1.0.pre25 app/helpers/shelves_helper.rb
enju_library-0.1.0.pre24 app/helpers/shelves_helper.rb
enju_library-0.1.0.pre23 app/helpers/shelves_helper.rb
enju_library-0.1.0.pre22 app/helpers/shelves_helper.rb
enju_library-0.1.0.pre21 app/helpers/shelves_helper.rb
enju_library-0.1.0.pre20 app/helpers/shelves_helper.rb
enju_library-0.1.0.pre19 app/helpers/shelves_helper.rb
enju_library-0.1.0.pre18 app/helpers/shelves_helper.rb
enju_library-0.1.0.pre17 app/helpers/shelves_helper.rb