Ruby on Rails Sunday, June 8, 2014

On Sunday, June 8, 2014 1:33:24 AM UTC+1, Dinna Gonzales wrote:
> Inside my home.html.erb. I am rendering a partial inside a modal for my sign-up.
>
>
>

>
>
> What I actually want to accomplish is rerendering the partial inside the modal once User.save does not work. Please help!!!! :(

For a response to update only a portion of the page instead of the whole page it has to be an ajax post. Rails does have some builtin support for ajax form submission ( http://guides.rubyonrails.org/working_with_javascript_in_rails.html#form-for). You'll have to write some javascript to handle the success/failure cases yourself (in particular the redirect in the success case will no longer do what you want - you have to do the redirect client side)

Fred

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/b88b520f-4344-4600-a60e-bd3f4411c8b8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment