1

So i have a little "i'm stuck' moment again.

Victim is a rails app with devise and want to implement Jcrop in it.

I orientated myself on the Railscasts #182 revised, because it fits nearly everything that my enviroment has/needs (Carrierwave upload) - so current status: Upload works and images are resized properly. My Problem is now - the Jcrop-Box doesn't appear.

As far as i saw in the code, this part (to be found here):

def update
    @user = User.find(params[:id])
    if @user.update_attributes(params[:user])
      if params[:user][:avatar].present?
        render :crop
      else
        redirect_to @user, notice: "Successfully updated user."
      end
    else
      render :new
    end
  end

handles the triggering of the crop file which has the cropbox (which can be found here)

But as far as i belive to know, the user controller actions for update and new are handled by devise. Has anyone an idea what i could do or how i can trigger the events on another way?

Michael Gajda
  • 105
  • 1
  • 2
  • 11
  • Did you try override RegistrationsController yet? for how to do that [click here](http://stackoverflow.com/questions/3546289/override-devise-registrations-controller) – Rafaiel Mar 05 '13 at 08:36
  • And here for [original code](https://github.com/plataformatec/devise/blob/master/app/controllers/devise/registrations_controller.rb) for RegistrationsController. – Rafaiel Mar 05 '13 at 08:51
  • As you see if you didn't touch password this will not take effect with devise. That mean you can create another controller to crop image. – Rafaiel Mar 05 '13 at 08:58

0 Answers0