Persist Facebook profile picture url on Rails 3

2.9k Views Asked by At

I added Facebook authentication to my Rails 3 app according to this tutorial, and it's working great.

Now I want to display the user's name and profile picture, once he/she has logged in to the app using Facebook. I tried following the solution given here: Rails: retrieving image from Facebook after Omniauth login with Devise

But then, I get the following error:

"Can't mass-assign protected attributes: name, image"

Any ideas on how I can get this to work?

1

There are 1 best solutions below

1
airlok On

You need to set

attr_accessible :name, :image

in the appropriate model.