It should work if you use fields="local_area.name" rather than
fields="local_area".   If you need access to local_area in your view,
you should be able to use this_parent rather than this.

Bryan


On Wed, Nov 28, 2012 at 10:46 AM, tonym <[email protected]> wrote:
> Thanks Bryan,
>
> that works, and neat too :)
>
> Just one 'gotcha' is that all the columns that are belongs_to relationships
> try to sort without referencing the id.
> e.g. http://localhost:3000/my_venues?sort=local_area is in the 'local area'
> column link,  but I can only get the sort with 'local_area_id'.
> I can work around this, but is this a fault or is there a way to sort by
> 'local area' without the id - i.e. can we sort alphabetically on the parent
> name?
>
> Thanks, Anthony
>
>
>
> On Wednesday, November 28, 2012 2:20:58 PM UTC, Bryan Larsen wrote:
>>
>> Actually, the call to index_response is not necessary.   Old
>> documentation was less misleading than I thought.
>>
>>   def index
>>     hobo_index do
>>       self.this = self.this.search(params[:search], :name) if
>> params[:search]
>>       self.this = self.this.order_by(parse_sort_param(:name,
>> :quantity)) if params[:sort]
>>     end
>>   end
>>
>> Bryan
>
> --
> 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/-/t6yw5VLjnJ4J.
>
> 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 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