1

I am using some tutorial to build some complex forms with nested attributes(project model and its nests attribute tags). The problem is tag. I have those inputs :

<input id="project_title" name="project[title]" type="text">

and

<input id="project_tags_attributes_1383080749618_pill" name="project[tags_attributes][1383080749618][pill]" type="text" placeholder="add a tag" style="display: none;">

but no tag attribute is set when submitting the form. I have in my log Parameters:

{"utf8"=>"✓", "authenticity_token"=>"4wly3xgZ3ge6pEc8pJAV0XPGbex0WJKoaQ8lVaoDNNA=", "project"=>{"title"=>"some_project", "tags_attributes"=>{"1383080749618"=>{"pill"=>""}}, "description"=>"descriptor"}, "commit"=>"Create project"}

What is weird is that when I check the pill's tag attribute value in my chrome console, just before submitting, I get a correct non null value... How can it be

1
  • are you using rails 4 ? Commented Nov 2, 2013 at 0:23

1 Answer 1

3

I have also ran into that kind of issue. Check if you don't have an unpermitted hash in your logs. If so, set in your project controller :

def project_params
  params.require(:dee).permit(:title, :description, tags_attributes: [:pill])
end 
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.