Sign in through GitHub

RailsCasts Pro episodes are now free!

Learn more or hide this

rossounay's Profile

GitHub User: rossounay

Comments by


Thanks to :

73. Anders Heie Nov 03, 2010 at 22:59
I'm a noob, so forgive me if what I write is not the correct procedure. After spending a couple of evenings on this, I managed to get this working for Rails 3 with the following changes (I'm trying to summarize all the experiences above).

1. Changed cropper.rb to this
(From Chris Your)

2. Move cropper.rb to the folder config\initializers

3. Added missing '=' in crop.html.erb:
<%= form_for @user do |f| %>

4. Remember to add crop_x, crop_y, Crop_w and crop_h to the list of your accessible attributes IF you have such a list:
attr_accessible :avatar, :crop_x, :crop_y, :crop_w, :crop_h

5. Added this line to my gemfile:
gem 'paperclip'

6. bundle install

7. Being on windows, I added the path to ImageMagick in my development environment:
Paperclip.options[:command_path] = "C:\\Progra~1\\ImageMagick-6.6.5-Q16"

I used the SHORT path with ~1, because I read somewhere there was a problem with spaces here.

8. Added jquery.Jcrop.min.js, jquery-1.4.3.min.js in public\javascripts folder

9. added Jcrop.gif and jquery.Jcrop.css in public\stylesheets folder

10. Added <%= yield(:head) %> in the <head> section in the application.html.erb file (needed for sample above)

11. Restart your server

Pfeyy... Hope that helps someone, it took a while to sort all this out :)[/quote]