The following happens,
I have this in the routes:
resources :professionals do
#...
resources :medical_records, controller: 'medical_records', only: [] do
collection do
get :report
end
end
end
And the action
within MedicalRecordsController
exists and is this:
def report
medical_records_scope = begin_of_association_chain.order('active DESC')
medical_records_scope = medical_records_scope.like(params[:filter].strip) if params[:filter]
@medical_records_report = medical_records_scope
respond_to do |format|
format.xlsx {
response.headers['Content-Disposition'] = 'attachment; filename="medical_records.xlsx"'
render disposition: 'inline'
}
end
end
The error message is that of the title, which does not find the action. According to the documentation
The action 'report' could not be found for MedicalRecordsController