Devise error - Reg

Hello.I have been following one month rails tutorial in which they developed a clone of Pinterest.In the tutorials,pins were created using paperclip gem.I tried to add profile avatars using paperclip gem.So i ran a migration to add an avatar to user table.I wanted the user to upload a picture on signup.I used Devise gem for authentication.So i modifed my views((signup.html.erb) and (edit.html.erb)).
I added parameter sanitizers in my application_controller to modify devise controller settings.But the problem is iam getting an UnknownAtrributeError:Avatar

And in the tutorial jquery-masonry gem was used to make it look a more like pinterest.It worked at first.But now itsn’t working.

I have attached the error screenshots and this is the link of my project on github:

https://github.com/arun1595/pinterest

Please reply me.I am stuck on this error for a long time.

Arun,

Did you add the field for avatar for user model ? you need to do 2 steps.

1.https://github.com/thoughtbot/paperclip#migrations

  1. run rake db:migrate

Restart server and check again .

Cheers

Vivek

Hi Arun,

did you permitted the “avatar” field in the strong parameters?

If you are using Devise, edit your application_controller.rb to something like this:

class ApplicationController < ActionController::Base
before_filter :configure_permitted_parameters, if: :devise_controller?

protected

def configure_permitted_parameters
devise_parameter_sanitizer.for(:sign_up) << :avatar
end
end

``