Skip to content

Instantly share code, notes, and snippets.

@ruprict
Created November 10, 2014 01:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ruprict/51db73c885e7892580a4 to your computer and use it in GitHub Desktop.
Save ruprict/51db73c885e7892580a4 to your computer and use it in GitHub Desktop.
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