Skip to content

Instantly share code, notes, and snippets.

@mbuttler
Created September 8, 2015 01:08
Show Gist options
  • Save mbuttler/204c3527ba933217d1cf to your computer and use it in GitHub Desktop.
Save mbuttler/204c3527ba933217d1cf to your computer and use it in GitHub Desktop.
Stack Level Too Deep
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