-
Notifications
You must be signed in to change notification settings - Fork 14
Tutorial - 5.7: Showing Posts #8
Comments
Your post is undefined. Do you have @post = Post.find(params[:id]) inside the show action of the Posts controller? |
This is my code for posts_controller.rb: class PostsController < ApplicationController def new def create
end private def show Could the error possibly be in routes.rb? Do I need another get statement? |
The issue might be that you put the show action under post_params. I'm pretty sure the private keyword applies to every method defined under it. Try moving show up above the private and see what happens. |
It works! Thanks for the help, I've been having a lot of trouble with this. |
Well, now you know not to put new actions in under the private. It's kind of weird that it would get that far before hitting an error though. You'd think it would have trouble finding the action in the first place if private is a problem. |
Either I screwed up something earlier in the code or I'm just missing something because I keep hitting wall after wall. I get this error message when I go to save a post:
Any help would be greatly appreciated.
The text was updated successfully, but these errors were encountered: