Sorting in rails 2.3.5 not same as sorting in (Rails 3.2.8)

18 views
Skip to first unread message

rails3 champ

unread,
Oct 31, 2012, 6:42:32 AM10/31/12
to rubyonra...@googlegroups.com
In rails 2.3.5 (with active scaffold) all my columns in display were
sorted even though they belonged to a related table. But in Rails 3.2.8
, only columns which belong to the main table are sorted .To sort a
related table column we need to specifically add the line below

columns[:columnfromtable2].sort_by :sql => ['name']

I have many columns which are 'related' in many pages , it would be
tedious to add this line in them all

--
Posted via http://www.ruby-forum.com/.

rails3 champ

unread,
Oct 31, 2012, 10:50:59 AM10/31/12
to rubyonra...@googlegroups.com
solved!!
Reply all
Reply to author
Forward
0 new messages