Thank you but I'm new to rails and hobo and I don't understand how to 
implement your example. Could you show me more maybe using what I have so 
far?
I've highlighted the problem area:  
            
       hobo_index Lead.active.apply_scopes(:search   => [params[:search], 
:name, :state],
      :order_by => 
parse_sort_param(:name,:bu,:probability,:teamsize,:duration,:created_at,:decision_date,:state,
:contact.company),
      :user_is => current_user,
      :bu_is => params[:bu])

On Monday, July 23, 2012 4:29:46 PM UTC+1, Bryan Larsen wrote:
>
> Are you using 1.4.0.pre7?  If so, that should actually work as is. 
>
> If you can't switch to 1.4.0.pre7, you can do something like: 
>
>     if parse_sort_param('user', 'user.email_address') 
>       db_sort_field = { 
>         "user" => "users.last_name", 
>         "user.email_address" => "users.email_address", 
>       }[@sort_field] 
>       order_by=[db_sort_field, @sort_direction] 
>     else 
>       order_by=["users.last_name", "asc"] 
>       @sort_field = "user" 
>       @sort_direction = "asc" 
>     end 
>
> then use :order_by => order_by 
>
> Bryan 
>
> On Mon, Jul 23, 2012 at 11:18 AM, tomkins wrote: 
> > I have a table plus with fields that I can order, using:  :order_by => 
> > parse_sort_param(:name, num) 
> > How can I do this for something like :company.contact so it would be 
> > :order_by => parse_sort_param(:name, num, company.contact) 
> > This gives an error when I navigate to the page the table is on. 
> > Thanks. 
> > 
> > -- 
> > You received this message because you are subscribed to the Google 
> Groups 
> > "Hobo Users" group. 
> > To view this discussion on the web visit 
> > https://groups.google.com/d/msg/hobousers/-/3cHHSq7XHjYJ. 
> > 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/hobousers?hl=en. 
>

-- 
You received this message because you are subscribed to the Google Groups "Hobo 
Users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/hobousers/-/KufXoW7dt48J.
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/hobousers?hl=en.

Reply via email to