Created
September 8, 2015 01:08
-
-
Save mbuttler/204c3527ba933217d1cf to your computer and use it in GitHub Desktop.
Stack Level Too Deep
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class PostsController < ApplicationController | |
def index | |
@new_post = Post.new | |
@all_posts = Post.order(created_at: :desc).all | |
end | |
def new | |
@new_post = Post.new | |
end | |
def create | |
@post = Post.new(post_params) | |
@post.save | |
redirect_to root_path | |
end | |
private | |
def post_params | |
post_params.require(:post).permit(:comment) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment