开发者

User avatar cropping/resizing with paperclip and jquery in rails

开发者 https://www.devze.com 2022-12-28 09:44 出处:网络
I am building my first Ruby on Rails app which is going to be my own little community. I have made the User model with several fields and information.

I am building my first Ruby on Rails app which is going to be my own little community. I have made the User model with several fields and information.

Now I am thinking of adding avatar support for the users. I've been researching and found that my best option would be using Paperclip, but then I encountered a little dilemma.

I want my users to be able to resize/crop their avatar image after they have chosen a image. I have Googled a lot and since i am using jQuery i f开发者_如何转开发ound that imgAreaSelect would be best in my opinion. And i think MiniMagick looks best.

So to my question. How can I best integrate Paperclip and imgAreaSelect? I am new to Ruby and Rails so i don't know how i can resize the image.

Do you folks know how to integrate the to or maybe some other options that fits my needs best?


Ryan Bates covered cropping images using Paperclip and JCrop in Railscast 182. I'd recommend that you check it out.

0

精彩评论

暂无评论...
验证码 换一张
取 消