Minor syntax change

While working on this very example recently, I found that Rails will throw POST errors if you leave an empty block in front the `format.js` when using either `remote: true` or vanilla  JS/JQuery.
This commit is contained in:
Zach 2016-05-10 11:34:12 -05:00
parent 6dec764519
commit bb53774a91
1 changed files with 1 additions and 1 deletions

View File

@ -328,7 +328,7 @@ this:
respond_to do |format|
if @user.save
format.html { redirect_to @user, notice: 'User was successfully created.' }
format.js {}
format.js
format.json { render json: @user, status: :created, location: @user }
else
format.html { render action: "new" }