ruby on rails - How to flatten the json produced by Rabl -
i'm starting out rabl , trying include parent attribute @ same level child.
this have far..
class usertag < activerecord::base belongs_to :tag attr_accessible :user_id, :tag_id end my index.json.rabl
object @usertag attributes :id child :tag attributes :name end produces
[{"usertag":{"id":1,"tag":{"name":"dolor et non."}}}, how flatten child node in template produces
[{"usertag":{"id":1,"name":"dolor et non." thanks!
Comments
Post a Comment