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

Ruby Build a Simple Ruby on Rails Application Getting Started with Rails Generate a Rails Application

Jack Hou
Jack Hou
6,975 Points

no atr_accessible in my status.rb folder

In the video, when he opens up the status.rb file there is a

atr_accessible name:string, content:text

but for me I simply have

class Status < ActiveRecord::Base
end

without anything in between. I have the same problem a few months ago, but I stopped learning ruby and am ready to pick it up again over summer. What am I doing wrong?

1 Answer

Naomi Freeman
STAFF
Naomi Freeman
Treehouse Guest Teacher

If you're in Rails 4, attr_accessible doesn't exist anymore.

Here's an example of how it needs to be constructed:

http://stackoverflow.com/questions/17371334/how-is-attr-accessible-used-in-rails-4 https://teamtreehouse.com/forum/rails-4-2

However, if you're configuring Devise, it needs to be constructed differently because of the components of the gem and how it sets itself up:

https://teamtreehouse.com/forum/rails-404