Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
M S
Courses Plus Student 5,705 Points`method_missing': undefined method `attr_accesible' for User
Hello,
I am starting with ror,and im getting this error
C:/Ruby200/lib/ruby/gems/2.0.0/gems/activerecord-4.1.0/lib/active_record/dynamic
_matchers.rb:26:inmethod_missing': undefined method attr_accesible' for User
(call 'User.connection' to establish a connection):Class (NoMethodError)
from C:/treebook/app/models/user.rb:6:in<class:User>'
from C:/treebook/app/models/user.rb:1:in <top (required)>'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/activesupport-4.1.0/lib/active_
support/dependencies.rb:443:inload'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/activesupport-4.1.0/lib/active_
support/dependencies.rb:443:in block in load_file'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/activesupport-4.1.0/lib/active_
support/dependencies.rb:633:innew_constants_in'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/activesupport-4.1.0/lib/active_
support/dependencies.rb:442:in `load_file'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/activesupport-4.1.0/lib/active_
.......
When i try to use "
rails generate migration add_user_id_to_statuses"
3 Answers
Dino Paškvan
Courses Plus Student 44,108 PointsTake a look at this thread and see if that helps.
bobkingstone
27,869 PointsHi,
Have you got a typo in your code?
It's reporting that it is missing': undefined method attr_accesible, this should be attr_accessible, you should check your code and see if there is a typo.
hope this helps.
Bob
M S
Courses Plus Student 5,705 PointsI tried that,but it did not help .I`m still getting that error. Maybe other have some ideas? P.S There was a typo,i checked it
M S
Courses Plus Student 5,705 PointsM S
Courses Plus Student 5,705 PointsI needed to add gem 'protected_attributes' into gemfile.Thanks