I'm pretty new to Ruby on Rails and i'm trying to build a simple blogging platform that allows user authentication using devise. When I fill out the posts form which takes a title and content field, when I press the "create post" button i get an error that reads
SystemStackError in PostsController#create stack level too deep
It seems as if the "create" action in my PostsController is where the problem stems from. Can any one help me? This is how my PostsController looks:
class PostsController < ApplicationController
before_action :authenticate_user!
def index
@posts = Post.all
end
def new
@post = Post.new
end
def create
@post = Post.new(params[:post])
end
def show
@post = Post.find(params[:id])
end
private
def params
params.require(:post).permit(:title, :content)
end
end