In the main page of the programs I can see all the programs and the LAST
comment for each program. That I use a helper function that just takes
the last comment.
I would add a parameter instead of a custom action:
/programs/1/comments?filter=last
In your controller, you can look at params[:filter] to find out what
kind of filter the client wants - you could support values like last,
first, or a number if they want to simply limit the result set.
I would add a parameter instead of a custom action:
/programs/1/comments?filter=last
Yeah I'll do it like that. Somehow I get the feeling that adding
parameters to a clean restful request breaks the rest rules. But I guess
that is a normal way of doing it.