You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
posts_path and post_path are helpers for different routes. The relevant section from README.md:
In this refactored create action, we're following the convention of redirecting to the new resource's show page. It stands to reason that a user who submits a new post would then like to view the successfully-created post. With that being said, the page flow is not set in stone, and we could've redirected the create action to the index action just as easily.
Below is what you have for this readme and wont pass unless post_path is changed to posts_path
def create
@post = Post.new
@post.title = params[:title]
@post.description = params[:description]
@post.save
redirect_to post_path(@post)
end
The text was updated successfully, but these errors were encountered: