# A few quick newbie questions

**URL:** <https://www.ruby-forum.com/t/a-few-quick-newbie-questions/173735>\
**Category:** Rails\
**Created:** [August 14, 2009, 12:17am UTC](https://www.ruby-forum.com/t/a-few-quick-newbie-questions/173735 "2009-08-14T00:17:51Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![peterbe](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/bc79bd/32.png) [@peterbe](https://www.ruby-forum.com/u/peterbe)\
**Post date:** [August 14, 2009, 12:17am UTC](https://www.ruby-forum.com/t/a-few-quick-newbie-questions/173735/1 "2009-08-14T00:17:51Z")

</div>

(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?

Is there anything detrimental to using lots of partials or nested  
partials? Does each one mean the sever has to open another file every  
time its not cached - and so slow things down?

I have a partial which makes some ajax tabs. This (for reasons  
currently beyond me!) means that the authenticity token changes, giving  
the ActionController::InvalidAuthenticityToken error. One suggested fix  
is to only protect put/delete/update, but that seems undesirable. Do I  
want to be useing with =\> authenticity\_token here? how?

Thanks in advance!!  
–Peter

---

<div class="post-metadata">

**Author:** ![peterbe](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/bc79bd/32.png) [@peterbe](https://www.ruby-forum.com/u/peterbe)\
**Post date:** [August 14, 2009, 1:18am UTC](https://www.ruby-forum.com/t/a-few-quick-newbie-questions/173735/2 "2009-08-14T01:18:46Z")

</div>

Peter E. 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](http://www.marnen.org)  
removed\_email\_address@domain.invalid
