Brian Hogan wrote:> Not following you. Why would you need to change the rendering? It should
> render just fine with the code you have below. No need to redirect on
> failure, only on success, just as your code below specifies. What
> exactly
> are you trying to do?
>
> A lot of your questions come without context,.,, consider adding some
> background to the problem you''re trying to solve when you show
code.
>
> On Thu, Jul 31, 2008 at 4:20 PM, Justin To
> <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org
Mmm...well I have the index page. And when a user clicks "new"
(:action
=> :new), a table slides_down with a form for the Post model in the
index page. There''s no ''new.html.erb''. Then when a
user submits (:action
=> :save_requirement), it is suppose to redirect_to :action => :index if
saved successfully. There is no ''save_requirement.html.erb'' so
I need to
render something otherwise I get the ''Missing Template'' error
if the
Post fails to save. Since my form was presented through ajax on my index
page, I need to display my error messages for the unsuccessful Post on
the table that slid_down in the index page that holds the Post form.
Therefore, I have to render :action => :index
At least, that''s the only way I''ve managed to do it. There is
one bug I
found with this method: the url stays the same
''/save_requirement'', when
I don''t want that there anymore if it was unsuccessful.
Hope that''s clearer,
thanks
--
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---