How do i pass the link text as a parameter to a controller i want to pass the string rather than the id??? Is there any way how can I do that? -- Posted via http://www.ruby-forum.com/.
You''ll need modify config/routes.rb file. Check http://manuals.rubyonrails.com/read/chapter/65 & http://wiki.rubyonrails.com/rails/pages/HowToRouteGenericURLsToAController Thanks, Pratik On 6/26/06, Satish <msksatish@gmail.com> wrote:> How do i pass the link text as a parameter to a controller i want to > pass the string rather than the id??? > > Is there any way how can I do that? > > > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- rm -rf / 2>/dev/null - http://null.in
Kevin Skoglund
2006-Jun-26 13:34 UTC
[Rails] Re: passing link text as parameter to a controller..
I believe that you can simply do: <%= link_to(''foo'', :action => ''bar'', :url => url_for(your_url)) %> But having never tried it, there may be times when that won''t work. You may have to experiment to make sure. HTH, Kevin Skoglund> You''ll need modify config/routes.rb file. > > Check http://manuals.rubyonrails.com/read/chapter/65 & > http://wiki.rubyonrails.com/rails/pages/ > HowToRouteGenericURLsToAController > > Thanks, > Pratik > > On 6/26/06, Satish <msksatish@gmail.com> wrote: >> How do i pass the link text as a parameter to a controller i want to >> pass the string rather than the id??? >> >> Is there any way how can I do that? >>