Merge pull request #33 from differentreality/final_difficulty_levels

Add difficulty levels
This commit is contained in:
Henne Vogelsang 2014-03-03 10:40:21 +01:00
commit 4ed72d4967
15 changed files with 119 additions and 3 deletions

View file

@ -71,6 +71,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
@ -102,6 +103,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