Skip to content

Instantly share code, notes, and snippets.

@chewmanfoo
Created December 14, 2017 14:30
Show Gist options
  • Save chewmanfoo/eb78b5e13b8250ac3b9478a11de2264b to your computer and use it in GitHub Desktop.
Save chewmanfoo/eb78b5e13b8250ac3b9478a11de2264b to your computer and use it in GitHub Desktop.
params and error
#...
def cf_deployment_params
params.permit(:env, :account, :delay, :deploy_at, :cf_template_id, :dry_run, cf_deployment:[:env, :account])
end
#...
when using curl -i -X POST -H "Content-Type:application/json" http://127.0.0.1:3000/cf_templates/1/cf_deployments -d '{"env":"cit_certification"}'
I see (in the logs):
Parameters: {"env"=>"cit_certification", "cf_template_id"=>"1", "cf_deployment"=>{"env"=>"cit_certification"}}
and the error:
Completed 500 Internal Server Error in 31ms (ActiveRecord: 9.2ms)
ActiveModel::UnknownAttributeError (unknown attribute 'cf_deployment' for CfDeployment.):
Rails.application.routes.draw do
# cf_deployments is nested within cf_templates
resources :cf_templates do
resources :cf_deployments
end
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment