I've created a helper for dealing with tables called TableHelper. I
have a method to deal with sorting asc or desc from within columns.
They involve images and some other transitions. Here's the code:
def sort_column(title, direction)
(link_to image_tag("up.gif", :border=>0),
rushing_offenses_path(:numteams => (@showall ? 120 : nil), :orderby =>
title, :sortby => direction)) if !...@searchteams
end
However, I'm trying to keep the code dry and I want to reuse the same
method for all of the models/views that require it. Unfortunately, it
has a default path pointing to the current controller which happens to
be rushing_offenses_path.
I want to call/change this path based on the controller that calls it.
Unfortunately, I searched forever, and watched many rails casts to see
if I could find the information. While I learned a ton of new things
with helpers today, I couldn't find any information on what I'm trying
to do.
Many thanks in advance.
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" 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/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---