When updating an event, user is then redirect to the displayed event.
Closes #105
This commit is contained in:
parent
08e53af140
commit
db2fd4eb96
@ -60,7 +60,7 @@ class EventsController < ApplicationController
|
||||
def update
|
||||
respond_to do |format|
|
||||
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 }
|
||||
else
|
||||
format.html { render action: 'edit' }
|
||||
|
@ -92,7 +92,7 @@ class EventsControllerTest < ActionDispatch::IntegrationTest
|
||||
}
|
||||
|
||||
assert_empty assigns(:event).errors.messages
|
||||
assert_redirected_to :root
|
||||
assert_redirected_to event_url(@event)
|
||||
end
|
||||
|
||||
test 'should not update event' do
|
||||
|
Loading…
Reference in New Issue
Block a user