In my code "
NoMethodError (attempt to call a private method): application / controllers / project_evaluations_controller.rb: 94: in `Calculate '
going on. SampleCode: for Controller :: Index and Show Method not mentioned.
class ProjectEvaluationsController < ApplicationController
skip_before_filter :verify_authenticity_token, :only => [:index, :show]
def calculate
@project_id = params[:id]
@costs_last_calculated = Time.now.utc
@total_internal_hours = 10
@total_external_hours = 20
@project_evaluation.update(:internal_hours => @total_internal_hours, :external_hours => @total_external_hours, :costs_last_calculated => @costs_last_calculated)
render :action=>"show"
end
end
Routes:
resources :project_evaluations do
match "calculate", :on => :collection
end
Suggest any solution !!!
source
share