Created
November 10, 2014 01:45
-
-
Save ruprict/51db73c885e7892580a4 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 create | |
@post = Post.new(post_params) | |
respond_to do |format| | |
Rails.logger.info "*** format = #{format.inspect}" | |
if @post.save | |
format.html { redirect_to root_path } | |
format.js # Will search for create.js.erb | |
else | |
format.html { render root_path } | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment