Witam
Mam problem z nie wiem czy to dobrze nazwałem ale przyjąłem sobie nadawaniem atrybutów to znaczy
[code]
first_page = Page.new(:name => “new page”, :permalink => ‘first’, :position => 1)
ActiveModel::MassAssignmentSecurity::Error: Can’t mass-assign protected attributes: name, permalink, position
from /home/wojtek/.rvm/gems/ruby-1.9.3-p286/gems/activemodel-3.2.8/lib/active_model/mass_assignment_security/sanitizer.rb:48:in process_removed_attributes' from /home/wojtek/.rvm/gems/ruby-1.9.3-p286/gems/activemodel-3.2.8/lib/active_model/mass_assignment_security/sanitizer.rb:20:in
debug_protected_attribute_removal’
from /home/wojtek/.rvm/gems/ruby-1.9.3-p286/gems/activemodel-3.2.8/lib/active_model/mass_assignment_security/sanitizer.rb:12:in sanitize' from /home/wojtek/.rvm/gems/ruby-1.9.3-p286/gems/activemodel-3.2.8/lib/active_model/mass_assignment_security.rb:230:in
sanitize_for_mass_assignment’
from /home/wojtek/.rvm/gems/ruby-1.9.3-p286/gems/activerecord-3.2.8/lib/active_record/attribute_assignment.rb:75:in assign_attributes' from /home/wojtek/.rvm/gems/ruby-1.9.3-p286/gems/activerecord-3.2.8/lib/active_record/base.rb:498:in
initialize’
from (irb):4:in new' from (irb):4 from /home/wojtek/.rvm/gems/ruby-1.9.3-p286/gems/railties-3.2.8/lib/rails/commands/console.rb:47:in
start’
from /home/wojtek/.rvm/gems/ruby-1.9.3-p286/gems/railties-3.2.8/lib/rails/commands/console.rb:8:in start' from /home/wojtek/.rvm/gems/ruby-1.9.3-p286/gems/railties-3.2.8/lib/rails/commands.rb:41:in
<top (required)>’
from script/rails:6:in require' from script/rails:6:in
'[/code]
tworze sobie jakiś model i dodaje go jak widać
first_page = Page.new(:name => "new page", :permalink => 'first', :position => 1)
i nie mogę nadać tych atrybutów name, position etc “hurtowo” - a mam je utworzone
tylko muszę przez powiedzmy - fist_page.name = “test”
dzięki z góry za odp