そのため、fb_graph gem を使用して Facebook からデータを取得し、アプリケーション内に新しいイベントを作成しています。問題は、remote_image_url を使用して、carrierwave 経由でアップロードする写真を取得できないように見えることです。これが organization.rb のコードです。
page = FbGraph::Page.fetch(uri, :access_token => token)
org_events = page.events({:fields => "name,description,picture,id,location,start_time"})
org_events.each do |event|
Event.create!(
:name => event.name,
:description => event.description,
:location => event.location,
:date =>event.start_time ,
:time => event.start_time,
:organization_id => self.id,
:remote_image_url => event.picture #broken code
)
end
モデルの上からマウントされたアップローダーと画像属性は次のとおりです。
attr_accessible :image
mount_uploader :image, ImageUploader
これは私が遭遇したエラーメッセージです--
Can't mass-assign protected attributes: remote_image_url