# A few quick newbie questions

**URL:** <https://www.ruby-forum.com/t/a-few-quick-newbie-questions/173728>\
**Category:** Ruby\
**Created:** [August 13, 2009, 10:53pm UTC](https://www.ruby-forum.com/t/a-few-quick-newbie-questions/173728 "2009-08-13T22:53:39Z")\
**Posts on this page:** 3\
**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 13, 2009, 10:53pm UTC](https://www.ruby-forum.com/t/a-few-quick-newbie-questions/173728/1 "2009-08-13T22:53:39Z")

</div>

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, 12:11am UTC](https://www.ruby-forum.com/t/a-few-quick-newbie-questions/173728/2 "2009-08-14T00:11:41Z")

</div>

On Fri, Aug 14, 2009 at 05:53:46AM +0900, Peter E. wrote:

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

Maybe this:

“&#{category\_name && ‘category=’ + category\_name}”

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

These are rails specific questions. You should try the ruby on rails  
mailing list:

[http://lists.rubyonrails.org/mailman/listinfo/rails](http://lists.rubyonrails.org/mailman/listinfo/rails)

---

<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:19am UTC](https://www.ruby-forum.com/t/a-few-quick-newbie-questions/173728/3 "2009-08-14T00:19:24Z")

</div>

Ah yes, I noticed this right after posting, and wasn’t sure what the  
correct action was - reposted.

And I’ll try the code you suggested - thanks!  
–Peter

> These are rails specific questions. You should try the ruby on rails  
> mailing list:
> 
> [http://lists.rubyonrails.org/mailman/listinfo/rails](http://lists.rubyonrails.org/mailman/listinfo/rails)
