Peter Ehrlich wrote:
> (posted this in Ruby mistakenly, reposting here)
> Hi
>
> A few things I'm wondering - if anyone can answer without too much
> trouble! (I know if I google enough I could learn what's going on..)
>
> I'm trying to make a string of url parameters, like this:
> "&#{unless category_name.nil?; 'category=' + category_name; end}"
> and like that for about three different variables. Is there a faster
> way?
Why are you doing this? It is usually better to pass options to link_to
or url_for, and let Rails take care of encoding the query string. There
are also some URL encoding methods that you can call directly if
necessary -- check the docs.
I can't really say enough about your other two questions to make an
answer worthwhile. Welcome to the Rails community!
Best,
--
Marnen Laibow-Koser
http://www.marnen.org
[email protected]
--
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
-~----------~----~----~----~------~----~------~--~---