On Apr 26, 2011, at 11:46 AM, Donald R. Ziesig wrote:

> Hi All, Its me again!
> 
> Sometimes beta testers can be a pain in the *, but they often find the most 
> amazing problems.
> 
> I have numerous situations where I want to be able to sort a table-plus based 
> on the value of a belongs_to field as in:
> 
> belongs_to :state_prov
> belongs_to :agent
> 
> in a simple table-plus header:
> 
> Name    Address    City State/Prov PostalCode Agent
> 
> The correct values appear when the table is displayed, but when the 
> beta-tester clicks on the header for either of these fields (for example, 
> they want to sort clients by their state/province or properties by their 
> listing agent), they get a totally blank rendering.
> 
> There is nothing there. No menu, no header stuff, its totally blank!
> 

Very strange - can you post the DRYML for the table-plus? The automatic 
order_by scope is supposed to handle sorting by 'some_belongs_to_association' 
as long as the model involved has a field declared with :name => true.

> P.S.  These fields appear as links in the table.  In some cases the link is 
> rather trivial (e.g. the state/province displays the name and abbreviation of 
> the state or province).  I would like to tell table-plus to just display 
> these without creating a link.

If you've got a bunch of these, you'll probably want to declare a <view> tag 
for the appropriate class; in a singular instance, you can swap out what 
table-plus shows for a cell with:
<table-plus ...>
  <agent-view:>
    ...do something useful here - 'this' is the Agent object here
  </agent-view:>
</table-plus>

--Matt Jones

-- 
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