mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-14 04:04:03 +00:00
Add flash type error.Rewrite controllers to use common flash style with redirect_to
This commit is contained in:
parent
dcdceb7c6d
commit
434eb90b76
16 changed files with 81 additions and 85 deletions
|
|
@ -67,12 +67,11 @@ module Admin
|
|||
@conference = Conference.new(conference_params)
|
||||
|
||||
if @conference.save
|
||||
flash[:notice] = 'Conference was successfully created.'
|
||||
|
||||
# user that creates the conference becomes organizer of that conference
|
||||
current_user.add_role :organizer, @conference
|
||||
|
||||
redirect_to admin_conference_path(id: @conference.short_title)
|
||||
redirect_to admin_conference_path(id: @conference.short_title),
|
||||
notice: 'Conference was successfully created.'
|
||||
else
|
||||
flash[:error] = 'Could not create conference. ' + @conference.errors.full_messages.to_sentence
|
||||
render action: 'new'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue