... | |
def new | |
@branch = params[:branch] | |
@categories = Category.where(branch: @branch) | |
@post = Post.new | |
end | |
def create | |
@post = Post.new(post_params) | |
if @post.save | |
redirect_to post_path(@post) | |
else | |
redirect_to root_path | |
end | |
end | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment