Add difficulty levels

This commit is contained in:
Stella 2014-02-23 16:09:09 +02:00
parent 4356616566
commit 5b35e25ecd
15 changed files with 119 additions and 3 deletions

View file

@ -70,6 +70,7 @@ class Admin::EventsController < ApplicationController
@comments = @event.root_comments
@comment_count = @event.comment_threads.count
@ratings = @event.votes.includes(:person)
@difficulty_levels = @conference.difficulty_levels
end
def edit
@ -101,6 +102,9 @@ class Admin::EventsController < ApplicationController
if params.has_key? :event_type_id
@event.update_attribute(:event_type_id, params[:event_type_id])
end
if params.has_key? :difficulty_level_id
@event.update_attribute(:difficulty_level_id, params[:difficulty_level_id])
end
if @event.update_attributes(params[:event]) && @event.submitter.update_attributes(params[:person])
flash[:notice] = "Successfully updated #{@event.title}."
else