Wednesday, August 4, 2010

[Rails] Re: How to inject a value in params when testing a helper method

Frederick Cheung wrote:
> On Aug 4, 4:09�pm, Marnen Laibow-Koser <li...@ruby-forum.com> wrote:
>> No you don't. �Your helpers don't have access to params, since they live
>> in the view layer. �You'll need to pass params[:question_status] in as
>> an @instance variable.
>
> They do - ActionView::Base delegates the params method (among others)
> to the controller

OK, then I'm sorry for the error. I still can't see why it's ever a
good idea to touch the params array in the view...

...though I suppose you could make the argument that the controller
shouldn't have to know it needs to set @question_status.

>
> Fred

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
marnen@marnen.org
--
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@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate