Thriving K. wrote:
In this case i want to get method name in view for example
- method name is “all_project_todos”
- method name is “completed_todos”
I can’t put my finger on it right now, but this approach feels wrong to
me. Maybe it has something to do with my embrace of RESTful style
applications, but those URLs look redundant to me. The are both
referencing a “Todo” resource identified by 14. It shouldn’t matter
whether it’s completed or not in this context.
As for the “all” and “completed” collection of “todos,” that could be
handled using named_scope. It just feels to me that the decision of what
to included in the collection is happing in the wrong place.
I would foresee URLs that look more like this:
All project todos:
Completed project todos:
All completed todos:
This approach eliminates the need you’re requesting. And, this is also
likely why you were having trouble finding answers to your question
through Google. All I’m saying is to take that as a sign that maybe
you’re attempting something unconventional and there might be a better
Take this reply as a nudge to think about your design and don’t take it
as criticism, which it certainly is not intended to be.