0

I'm quite new at rails and ruby so I'm not even sure if this is necessary, but I'm trying to add attributes to my model that are of one of my homemade classes. In the tutorials I've read, the attributes are just listed after attr_accessible and the types of those attributes are not defined. My question is: how do I define the type/class of an attribute or do I even have to?

1
  • Could you share some Code please ? Commented Jul 29, 2013 at 14:50

1 Answer 1

1

Those types (String, Date, for example) are defined in your database...activerecord will read the attributes from your database.
You can read more here, and can always use the guide

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.