Skip to content


Rails 4 Strong Parameters nested attributes with a key associated with an Object. #9051

burmjohn opened this Issue · 4 comments

3 participants


I was playing around with Rails 4 beta and trying to get nested attributes working with carrierwave, however I ran across an issue. Unless I am doing something wrong I believe this may be a bug. I could not find any references anywhere dealing with this. Thank's in advance.

upload = tempfile:"abc"), filename: "abc"
params = screenshot: { title: "afa", assets_attributes: {"0" => {filename: upload}}}
p = params.require(:screenshot).permit(:title, assets_attributes: :filename)

# => {"title" => "afa", "assets_attributes"=>{"0"=>{}}}

This seems to be related to rails/strong_parameters#89 /cc @fxn


Could you please log params.inspect?


Ah, sorry, didn't realize the snippet is isolated. I believe we need to add ActionDispatch::Http::UploadedFile to the list of permitted scalars, we only allow IO and StringIO right now.


If there is anything else you need let me know.

@fxn fxn closed this in 8ac94d7
@nicolasiensen nicolasiensen referenced this issue from a commit in nicolasiensen/helpful-web
Nícolas Iensen Update Rails to 4.1.1 since 4.1.0 had a bug with attachments upload #… 7f08bc9
@nicolasiensen nicolasiensen referenced this issue in asm-helpful/helpful-web

Add attachments support for messages #467 #221

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.