On Oct 5, 2011, at 3:48 PM, Walter Lee Davis wrote:
> 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 found that substituting to_param for id makes FriendlyId work correctly
again, and this one is solved. Still seems awfully long-hand.
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.