Ruby on Rails : symbol as argument in form_for?

Up vote 2 down vote favorite 1 share g+ share fb share tw.

I understand what is passed to the form_for method when doing something like : ... if @user is set in the controller. This is pretty obvious. But what happens when we pass :user, as I have seen in many examples?

... When should I use the symbol version? Ruby-on-rails form-for link|improve this question edited Jan 5 '10 at 13:50 asked Jan 5 '10 at 13:41subtenante4,31712960 92% accept rate.

Using the symbol will generate: Using the object @user set to new you get: If you set @user to something else it will change the form tag generated, of course ... try it out for yourself. In the end it all depends what you're trying to do. You might want to use the symbol if you have multiple :user forms on the same page.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions