Class: EstimatesController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- EstimatesController
- Defined in:
- app/controllers/estimates_controller.rb
Constant Summary
Constants included from Localization
Localization::LOCALIZED_STRINGS
Instance Method Summary collapse
Methods inherited from ApplicationController
in_place_edit_for, #initialize
Methods included from ApplicationHelper
#back_or_link_to, #detour?, #detour_to, #display_notice, #h, #image_button_to, #image_detour_to, #image_link_to, #image_link_to_remote, #insert, #record, #resolution_image, #t, #update_task, #with_detour
Methods included from Localization
#l, load_localized_strings, #valid_language?
Constructor Details
This class inherits a constructor from ApplicationController
Instance Method Details
#create ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 |
# File 'app/controllers/estimates_controller.rb', line 6 def create @success, flash[:notice] = do_create unless @success @task.errors.add :estimate, flash[:notice] render :file => "public/500.html", :layout => true, :status => 500 return end redirect_to :controller => 'periods', :action => :show, :id => @task.root_task.period, :task_id => @task.id end |
#create_ajax ⇒ Object
18 19 20 21 22 23 24 |
# File 'app/controllers/estimates_controller.rb', line 18 def create_ajax @task = Task.find_by_id(params[:id]) @success, flash[:notice] = do_create if @task.finished? render :template => '/tasks/finish', :layout => false end end |