Ruby on Rails Monday, August 30, 2010

Colin Law wrote:
> On 30 August 2010 21:17, Ithelp Eighty-five <lists@ruby-forum.com>
> wrote:
>>> the field in the object being passed to the view. �So if the object is
>>> @my_thing and the field is value then set @my_thing.value = "" or
>>> possibly nil might be better.
>>>
>>> Colin
>>
>> Where should this code go? In the Model, View, or controller?
>
> After the failed save, which is in the update and/or create action of
> the controller. I think maybe the fact that you had to ask that
> question means you might benefit from working through the Rails Guides
> (google it).
>
> Colin

Thanks I had just realize it went in the controller.

Another question... if I want to set a field blank for each field that
had an error how would i do that?
--
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.

No comments:

Post a Comment