Hi, i''ve a page where when a params[:something] is passed all/some the
urls in that page must have the params[:something] too, but when there
isn''t it shouldn''t appear.
I''ve tried with:
report_url(params[:id], :something => params[:something])
this works when there is the params[:something], but it doesn''t when
there isn''t, as the result is:
http://localhost:300/report/1?something
So i''ve tried with
tmp = params[:something] ? {:something => params[:something]} : {}
report_url(params[:id], tmp)
This is better, because works when there is the parameter, and almost
does when there isn''t, as the result is:
http://localhost:300/report/1?
Is there any way to have the two results
http://localhost:300/report/1?something=123 and
http://localhost:300/report/1 when there is and there isn''t the
parameter? Without having the question mark at the end in the second
case
--
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
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---