I want to pass an array of custom objects to the view layer to render. Rails expects to be able to call “model_name” and a bunch of other methods for routing on its models.
If I want to make a custom class that I can pass to methods like “render”, what methods does it need to respond to?
Ideally I would like these objects to be usable outside rails as well.
If you are using Rails 3 then it might be worth extending
ActiveModel.See these posts for more info: