mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
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:
parent
6dec764519
commit
bb53774a91
1 changed files with 1 additions and 1 deletions
|
@ -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" }
|
||||
|
|
Loading…
Reference in a new issue