提交 bb53774a 编写于 作者: Z Zach

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.
上级 6dec7645
...@@ -328,7 +328,7 @@ this: ...@@ -328,7 +328,7 @@ this:
respond_to do |format| respond_to do |format|
if @user.save if @user.save
format.html { redirect_to @user, notice: 'User was successfully created.' } format.html { redirect_to @user, notice: 'User was successfully created.' }
format.js {} format.js
format.json { render json: @user, status: :created, location: @user } format.json { render json: @user, status: :created, location: @user }
else else
format.html { render action: "new" } format.html { render action: "new" }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册