When updating an event, user is then redirect to the displayed event.

Closes #105
This commit is contained in:
echarp 2018-03-17 16:53:38 +01:00
parent 08e53af140
commit db2fd4eb96
2 changed files with 2 additions and 2 deletions

View File

@ -60,7 +60,7 @@ class EventsController < ApplicationController
def update def update
respond_to do |format| respond_to do |format|
if @event.update event_params if @event.update event_params
format.html { redirect_to :root, notice: t('.ok') } format.html { redirect_to @event, notice: t('.ok') }
format.json { head :no_content } format.json { head :no_content }
else else
format.html { render action: 'edit' } format.html { render action: 'edit' }

View File

@ -92,7 +92,7 @@ class EventsControllerTest < ActionDispatch::IntegrationTest
} }
assert_empty assigns(:event).errors.messages assert_empty assigns(:event).errors.messages
assert_redirected_to :root assert_redirected_to event_url(@event)
end end
test 'should not update event' do test 'should not update event' do