ging / social_stream

A framework for building distributed social network websites
http://social-stream.dit.upm.es/
MIT License
1.13k stars 307 forks source link

ActiveModel::MassAssignmentSecurity::Error in HomeworksController#create #480

Open Brainstorm00 opened 10 years ago

Brainstorm00 commented 10 years ago

Hi everybody,

I have this error when I try to create something with my new activity

Can't mass-assign protected attributes: author_id, user_author_id, owner_id Rails.root: /Users/project/social_stream-started

Application Trace | Framework Trace | Full Trace Request

Parameters:

{"utf8"=>"✓", "authenticity_token"=>"wb37v0nNpMb3dVu3EEPKt3IDdnxXoYhUM9HwzSDdvyk=", "homework"=>{"type"=>"1", "activity_object_id"=>"1", "file_file_name"=>"1", "file_content_type"=>"1", "file_file_size"=>"1", "file_processing"=>"0"}, "commit"=>"Create Homework"}

what does it wants ? :D

abelard2008 commented 9 years ago

I am not sure some one will meet the same question as mine. After I run "rails g scaffold Xoxo ...", some other steps as described in How to add new activity objects and access "http://127.0.0.1/xoxos/new", I got the above error. The resolution is simple: Delete models/xoxo.rb's one line with "attire_accessible" like:

attr_accessible :draft, :json, :title