Displaying 1 result from an estimated 1 matches for "sort_country".
Did you mean:
cont_country
2006 Mar 07
1
decorators for models?
...s)
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/.