タイトルの通りなのですが、
location:が何の役割を果たしているのかがわかりません。
例の6行目です。
ruby
1 2def create 3 @note = Note.new(note_params) 4 respond_to do |format| 5 if @note.save 6 format.html { redirect_to @note, notice: 'Note was successfully created.' } 7 format.json { render :show, status: :created, location: @note } 8 else 9 format.html { render :new } 10 format.json { render json: @note.errors, status: :unprocessable_entity } 11 end 12 end 13 end

回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2017/03/06 02:55