I have table-plus working very well finally.  However, one thing I've
found bugs me, and either I'm missing something or the call to
apply_scopes is violating DRY at some level.

My controller is as follows:

def index
    @projects = Project.apply_scopes(:search => [params
[:search], :name], :order_by => parse_sort_param
(:name, :start_date, :target_date, :completion_date, :status, ...))
    hobo_index @projects
  end

I find that unless a field is explicitly specified in
parse_sort_param, the column heading shows up on the page as an active
link, but clicking on it does nothing (except to refresh the page and
return it to "default" sort order).

Seems like parse_sort_param ought to take something like an :all
parameter, to enable sorting by any of the columns that are displayed.

Is there a standard way to access the list of columns by which to
sort?

I was thinking one solution may be to make list of columns an
attribute of the model or the controller.  The thing is, I'd need to
access it from my controller.rb for the apply_scopes call, and from
the index.dryml file for the table-plus "fields" argument.  For that
matter, I'd probably want the same list accessible by my model, since
that's where I define fields for my call to acts_as_csv_exportable ...

thoughts?
--~--~---------~--~----~------------~-------~--~----~
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