On 13 November 2014 17:35, Zdravko Balorda <li...@ruby-forum.com> wrote:
> I use SortHelper which provides for sorting by any column of the table.
> With patient name I would like to have only one column. The combined
> column could be 'name' as in:
> select ..., lastname||', '||firstname as name from patients... order by
> name
>
> This column does not appear in the table itself. It is concatenated
> column. Ordering by name would also provide for correct ordering. Can I
> fool SortHelper to use such a fake column (not in the model) to work
> with?

No idea as I don't know what SortHelper is, and a quick google
revealed nothing that looked in any way current.  Why would you not
want to do this the most efficient way which is likely to be when
fetching from the database?

Note that if you just concatenate the columns you will be unlikely to
get what you want, as you need it to sort on lastname then firstname,
which may not be the case if you just concatenate the strings.

Colin

>
> --
> Posted via http://www.ruby-forum.com/.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Ruby on Rails: Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to rubyonrails-talk+unsubscr...@googlegroups.com.
> To post to this group, send email to rubyonrails-talk@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/rubyonrails-talk/b7d3c6442bf4e43a6a976ffbfaf7af45%40ruby-forum.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/CAL%3D0gLu9G6Zxf83v5RmipjnmWczKismKpQTGFj%3D%3DT42OmZ1BEw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to