Reputation: 3489
I'm trying to add a small part(callback for jsonp) to my /groups/1/clients.json
file. But I don't know which method in groups(or clients) formats that json file for me.
I've tried editting my clients#show and clients#index and also my groups#show and groups#index methods; to no avail.
Thanks in advance
Upvotes: 0
Views: 232
Reputation: 911
according to your url "/groups/1/clients", it call clients controller index method only because there are nested resources so groups is the parents of clients, so that means group 1's all clients show so it call index methods of clients. so put your json code inside clients controller's index methods
Upvotes: 2