add bootstrap-switch for is_highlight

This commit is contained in:
Stella Rouzi 2014-12-13 21:13:19 +02:00 committed by Stella
parent 2dd326c8b9
commit a845dd5d7d
9 changed files with 45 additions and 12 deletions

View file

@ -106,9 +106,14 @@ module Admin
def update
if @event.submitter.update_attributes(params[:user]) &&
@event.update_attributes(params[:event])
@event.update_attributes(params[:event])
if request.xhr?
render js: 'index'
else
flash[:notice] = "Successfully updated event with ID #{@event.id}."
redirect_back_or_to(admin_conference_event_path(@conference.short_title, @event))
end
else
@url = admin_conference_event_path(@conference.short_title, @event)
flash[:notice] = 'Update not successful. ' + @event.errors.full_messages.to_sentence