Fixes to conference creation process

This commit is contained in:
Andrew Radev 2015-04-29 12:00:17 +02:00
parent 4ffbe5e68f
commit ea981aa0c9
2 changed files with 10 additions and 3 deletions

View File

@ -11,8 +11,12 @@ module Management
def create def create
@conference = Conference.new conference_params @conference = Conference.new conference_params
@conference.save
render :new if @conference.save
redirect_to [:management, @conference]
else
render :new
end
end end
def update def update

View File

@ -22,7 +22,9 @@ nav.navbar.navbar-static-top.navbar-inverse role="navigation"
li class="#{'active' if controller_name == 'sessions'}" li class="#{'active' if controller_name == 'sessions'}"
= link_to management_users_path do = link_to management_users_path do
=> icon 'user', User.model_name.human(count: 2).mb_chars.capitalize, class: 'fa-fw' => icon 'user', User.model_name.human(count: 2).mb_chars.capitalize, class: 'fa-fw'
- if @conference.present?
-# TODO Instead of this, provide a generic `yield :navigation`?
- if @conference.present? and @conference.persisted?
li class="#{'active' if controller_name == 'events'}" li class="#{'active' if controller_name == 'events'}"
= link_to management_conference_events_path(@conference) do = link_to management_conference_events_path(@conference) do
=> icon 'file-text', Event.model_name.human(count: 2).mb_chars.capitalize, class: 'fa-fw' => icon 'file-text', Event.model_name.human(count: 2).mb_chars.capitalize, class: 'fa-fw'
@ -32,6 +34,7 @@ nav.navbar.navbar-static-top.navbar-inverse role="navigation"
li class="#{'active' if controller_name == 'volunteerships'}" li class="#{'active' if controller_name == 'volunteerships'}"
= link_to '#' do = link_to '#' do
=> icon 'hand-o-up', t('activerecord.models.volunteership', count: 2).mb_chars.capitalize, class: 'fa-fw' => icon 'hand-o-up', t('activerecord.models.volunteership', count: 2).mb_chars.capitalize, class: 'fa-fw'
ul.nav.navbar-nav.navbar-right ul.nav.navbar-nav.navbar-right
li.dropdown li.dropdown
= link_to '#', class: 'dropdown-toggle', data: {toggle: 'dropdown'} do = link_to '#', class: 'dropdown-toggle', data: {toggle: 'dropdown'} do