I\'m looking to render an index of all articles along with a full article via JSON in my rails app, but I\'m having a little trouble figuring out how to do it.
Here
I would recommend overloading the attributes method to return an alternat hash that will be automatically used in to_json output.
class Article
def attributes
{ ... } # define your hash that you want to return at the '...'
end
end
To me this seems much simpler than mucking around with to_json directly.