Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
A rails plugin for making lists!
Ruby
branch: master

This branch is 13 commits behind jede:master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
tasks
test
MIT-LICENSE
README
Rakefile
init.rb
install.rb
uninstall.rb

README

ListFor
=======

Nifty plugin for making beautiful lists in rails. You get sorting, filtering and much more for free!

Example
=======

<% list_for(@company_fair_relations, :sort => [:company, :name]) do |list| %>
  <% list.column [:company, :name], :filter => true do |company_fair_relation| %>
    <%= link_to company_fair_relation.company.name, edit_fair_company_fair_relation_path(@fair, company_fair_relation) %>
  <% end %>
  
  <%= list.column [:state, :humanize], :filter => {:choices => CompanyFairRelation.states.collect{|s| s.to_s.humanize}} %>
  <%= list.column [:responsible, :to_s], :filter => {:choices => Person.find_all_by_permission(:can_be_responsible_for_company).collect{|s| s.to_s}.sort } %>
  <%= list.column :updated_at, :alias => 'Last changed' %>
  <%= list.column :priority %>
  
  <% list.actions do |company_fair_relation| %>
    <%= link_to image_tag("delete.png", :class => :icon, :style => "padding: 0px;"), fair_company_fair_relation_path(@fair, company_fair_relation), :confirm => 'Are you sure?', :method => :delete %>
  <% end %>
<% end %>


Copyright (c) 2008 Johannes Edelstam, released under the MIT license
Something went wrong with that request. Please try again.