annotate app/controllers/.svn/text-base/project_enumerations_controller.rb.svn-base @ 774:58410c63bb84 feature_334

Force a Google search box rudely into the middle of the search view, just to see how it looks. It can be styled reasonably well -- but the adverts, when they appear, are atrocious.
author Chris Cannam <chris.cannam@soundsoftware.ac.uk>
date Thu, 17 Nov 2011 14:56:55 +0000
parents 40f7cfd4df19
children
rev   line source
chris@22 1 class ProjectEnumerationsController < ApplicationController
chris@22 2 before_filter :find_project_by_project_id
chris@22 3 before_filter :authorize
chris@22 4
chris@22 5 def update
chris@22 6 if request.put? && params[:enumerations]
chris@22 7 Project.transaction do
chris@22 8 params[:enumerations].each do |id, activity|
chris@22 9 @project.update_or_create_time_entry_activity(id, activity)
chris@22 10 end
chris@22 11 end
chris@22 12 flash[:notice] = l(:notice_successful_update)
chris@22 13 end
chris@22 14
chris@22 15 redirect_to :controller => 'projects', :action => 'settings', :tab => 'activities', :id => @project
chris@22 16 end
chris@22 17
chris@22 18 def destroy
chris@22 19 @project.time_entry_activities.each do |time_entry_activity|
chris@22 20 time_entry_activity.destroy(time_entry_activity.parent)
chris@22 21 end
chris@22 22 flash[:notice] = l(:notice_successful_update)
chris@22 23 redirect_to :controller => 'projects', :action => 'settings', :tab => 'activities', :id => @project
chris@22 24 end
chris@22 25
chris@22 26 end