On 4 Oct 2008, at 18:31, Peter Ab wrote:
> > > ok, i think i understand now after playing with it for a bit. it > looks > like the 'render :action => new' runs the code from the new method but > with all the context of the method from which it came where as > redirect_to starts with a clean context. It does not run the new method at all. It just renders the template that the new action would have rendered. So in a typical example, the new method would just do def new @foo = Foo.new end ie the new method just starts out with an empty (all attributes set to the defaults) instance of Foo. If you call render from your create method then instead of having that empty instance of Foo, you've got the one you created from the user input so all the fields the user had filled it would be filled in and so on. > so, i still have 2 actions (methods) show and complete but if i find > an > error in complete, i now *render* show again and have all the > context of > what i had in complete. when i used redirect_to, it also went to show > but it cleared out the context. That's about right. Fred > > > thanks for the pointer, fred. > > -peter > -- > 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 [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---

