Last active
November 8, 2017 17:25
-
-
Save domagude/5ea79725aac30e31edfdcb17c5526ef6 to your computer and use it in GitHub Desktop.
This file contains 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
... | |
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