* Phlip <[email protected]> [2009-01-25 08:32:22 -0800]:

> 
> Xie Hanjian wrote:
> 
> > orderby = case @order
> >           when 'user' then 'user'
> >           when 'score' then 'score DESC'
> >           else 'updated_on DESC'
> >           end
> 
> That's better than mine by preserving the DESC.
> 
> But why the params and session themselves don't contain the real code - 
> 'updated_on DESC'. The View could, for example, show 'date' to the user and 
> set 
> its value to 'updated_on DESC'. Then all this fun goes away!

Agree. The only reason may be security - user would know your table
column name 'updated_on' if you use it directly in view.

Jan

> 
> 
> --~--~---------~--~----~------------~-------~--~----~
> You received this message because you are subscribed to the Google Groups 
> "Ruby on Rails: Talk" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to 
> [email protected]
> For more options, visit this group at 
> http://groups.google.com/group/rubyonrails-talk?hl=en
> -~----------~----~----~----~------~----~------~--~---

-- 
jan=callcc{|jan|jan};jan.call(jan)

Attachment: pgpMUjfQRk1IE.pgp
Description: PGP signature

Reply via email to