Notes posted by e-vive
RSS feed
0 thanks
another way
Perhaps a more efficient way:
def create @post = Post.new(post_params) if @post.save redirect_to @post, notice: "The post #{@post.title} was added to the system." else render action: 'new' end end
where post_params is:
private def post_params params.require(:post).permit(..attributes to permit..) end

