Throwing this out there to seed the google groups search engine, since
it would have helped me...

Using table-plus to implement my model's index page, I wanted to
change the label above two of my columns.

This is super-easy - table-plus offers a "xxx-heading-link" tag to do
just this, where xxx is the column name.  The only trick was figuring
out the not-really-documented distinction between xxx-heading-link and
xxx-heading.

To illustrate, here's the index.dryml for my FileSet model:

<index-page>
  <collection: replace>
    <table-plus fields="this, custodian, data_type, origin, date_from,
date_to, size_megabytes, size_items">
      <empty-message:>No file sets have been created.</empty-message:>
      <size_megabytes-heading-link:>Volume</size_megabytes-heading-
link:>
      <size_megabytes-view:><%= number_to_human_size(this*1024*1024)
%></size_megabytes-view:>
      <size_items-heading:>Items</size_items-heading:>
      <size_items-view:><%= number_with_delimiter(this) %></size_items-
view:>
    </table-plus>
  </collection:>
</index-page>

Above, <size_megabytes-heading-link:> shows the "right" way to
override the column heading, as (despite its name) it doesn't mess
with the link, just the text of the heading.  Note however,
<size_items-heading:> shows the "wrong" way to change the heading, as
(despite its name) it changes the entire heading, meaning that it
eliminates the click-to-sort link and the sort indicator arrows, in
addition to the default heading text.

(Illustration on calling rails number helpers included, at no extra
charge!)

Share & Enjoy.

(Now, to figure out a DRY way to make all my numeric columns right
align...)
--~--~---------~--~----~------------~-------~--~----~
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