Ruby on Rails Wednesday, May 25, 2016

On Wed, May 25, 2016 at 7:40 AM, Aditya Tyagi wrote:

> i am getting the missing template error when i try to update my post.
>
> Missing template posts/update, application/update
...
> POST_CONTROLLER.RB
>
> class PostsController < ApplicationController
...
> def update
>
> end

Once you have typical code in the controller to handle updates, you'll
no longer have this problem. A typical update action redirects to
show on success, and renders the edit template on failure. Either
one, though, is *explicit*. As several posters here regularly say, I
recommend you work your way straight through a good tutorial, such as
https://www.railstutorial.org/.

-Dave

--
Dave Aronson, consulting software developer of Codosaur.us,
PullRequestRoulette.com, Blog.Codosaur.us, and Dare2XL.com.

--
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/CAHxKQijR24VzWNo_A%2BD37mjhbfLnSAQLA3zKP0U1wTXnQwcN2A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment