I'm trying to add paging parameters to link_to inside an application_helper
method.
def index_show_link(elm, link_text = 'Show')
(can?(:read, elm)) ? link_to( link_text, elm ) : ' '.html_safe
end
I want to add the :page => params[:page] pair into the link, but I can't seem
to find a way to add it. If I use the long-hand syntax: {:id => elm.id,
:controller => controller_name, :action => :show, :page => params[:page]} then
it works, but that also horses around with friendly_id.
I've looked through the link_to and url_for documentation, and I can't see a
way to pass the bare object to either method and also include the extra
parameter.
What's the trick?
Thanks,
Walter
--
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.