Displaying 1 result from an estimated 1 matches for "testprojecttitle".
2011 Apr 17
0
newbie: to_json only/except + association confusion
..."is_enabled = ?", 1)
D)#OK, but json output not nice
format.json { render :json => @project.to_json(:only =>
[:title ], :method=> get_enabled_tasks ) }
def get_enabled_tasks
ActiveRecord::Base.connection.execute(sql)
>>
"project":{"title":"testprojecttitle","get_enabled_tasks":
[["tasktitle","user1","1.1.2011"]]}}
>> so, how can i get filtered associations in a to_json call so that i actually get goodlookin json?
thx
--
You received this message because you are subscribed to the Google Groups...