Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't crop depending on the order of the crop's params #14

Open
brunovelasco opened this issue Jun 4, 2015 · 0 comments
Open

Can't crop depending on the order of the crop's params #14

brunovelasco opened this issue Jun 4, 2015 · 0 comments

Comments

@brunovelasco
Copy link

Whenever using accepts_nested_attributes_for and within its hash params, when the Carrierwave field comes as first the attribute, the cropping doesn't work. It only works when it is the last.

For example, this works (picture params (Carrierwave's) as last) :

Project.create "pictures_attributes"=>{
  "0"=>{
    "picture_crop_x"=>"0", 
    "picture_crop_y"=>"0", 
    "picture_crop_w"=>"200", 
    "picture_crop_h"=>"200", 
    "picture"=> File.open('/path/img.png')
  }
}, "name"=>"A name"

And this doesn't work (picture params as first):

Project.create "pictures_attributes"=>{
  "0"=>{
    "picture"=> File.open('/path/img.png'), 
    "picture_crop_x"=>"0", 
    "picture_crop_y"=>"0", 
    "picture_crop_w"=>"200", 
    "picture_crop_h"=>"200" 
  }
}, "name"=>"A name"

I haven't tried for regular params, only for the accepts_nested_attributes_for.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant