Displaying 1 result from an estimated 1 matches for "datagrid_row_style".
2006 Mar 07
1
decorators for models?
...e that would return humanized 
column descriptions (i.e. order_status -> Order status)
This is how one such decorator could look like
class OrdersDecorator < ActiveRecord::Decorator
  @datagrid_fields=%w(id, name, country)
  def datagrid_field_title_id
    "Order ID"
  end
  def datagrid_row_style(m)
    ''big-order'' if m.total>100
  end
  def sort_country(a,b,direction)
   return a.continent<b.continet #sort countries by continent, not by 
name
  end
end
What do you think?
-- 
Posted via http://www.ruby-forum.com/.