Rails: Using Custom Classes in Rails

I want to pass an array of custom objects to a view layer for rendering. Rails expects to be able to call model_name and many other routing methods on its models.

If I want to create my own class that I can pass to the render methods, what methods should it answer?

Ideally, I would like these objects to be used outside the rails.

+5
source share
1 answer

If you're using Rails 3, it might be worth expanding ActiveModel.

See these posts for more information:

0

All Articles