mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
Fix create conference form
- adds HTML 5 validations
This commit is contained in:
parent
adfa9cc871
commit
27f35a49c6
4 changed files with 21 additions and 15 deletions
|
|
@ -15,10 +15,13 @@ class Admin::ConferenceController < ApplicationController
|
|||
|
||||
def create
|
||||
@conference = Conference.new(params[:conference])
|
||||
if @conference.save
|
||||
redirect_to(admin_conference_path(:id => @conference.short_title), :notice => 'Conference was successfully created.')
|
||||
if @conference.valid?
|
||||
@conference.save
|
||||
redirect_to(admin_conference_path(id: @conference.short_title),
|
||||
notice: 'Conference was successfully created.')
|
||||
else
|
||||
render :action => "new"
|
||||
redirect_to(new_admin_conference_path,
|
||||
flash: { error: @conference.errors.full_messages.join('! ') })
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue