diff options
author | Zach <zmeyer@gmail.com> | 2016-05-10 11:34:12 -0500 |
---|---|---|
committer | Zach <zmeyer@gmail.com> | 2016-05-10 11:34:12 -0500 |
commit | bb53774a91f9bef963f56c019fa8bea12a0f3435 (patch) | |
tree | 36c0f55d21115aa03e25a3eda15afe6dbf819b21 | |
parent | 6dec7645192bd89d81d47542255a346f93710830 (diff) | |
download | rails-bb53774a91f9bef963f56c019fa8bea12a0f3435.tar.gz rails-bb53774a91f9bef963f56c019fa8bea12a0f3435.tar.bz2 rails-bb53774a91f9bef963f56c019fa8bea12a0f3435.zip |
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.
-rw-r--r-- | guides/source/working_with_javascript_in_rails.md | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/guides/source/working_with_javascript_in_rails.md b/guides/source/working_with_javascript_in_rails.md index c58aee96db..c1dfcab6f3 100644 --- a/guides/source/working_with_javascript_in_rails.md +++ b/guides/source/working_with_javascript_in_rails.md @@ -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" } |