Hacker News new | past | comments | ask | show | jobs | submit login

I don't agree with the solution, but he does start off with a good point -- sometimes you have to write a lot of awkward code just to define very simple REST-style resources, whether it's for a public/private api or just some ajax accessible actions for an application.

What's different about the action he describes (and RESTful actions in general) is that the controller essentially gets in the way of accessing the model directly. What he really wants is an rpc call from javascript (or some other internal service), but to do so in the rails paradigm, he has to create a "webpage" which prints out 3.

At the same time though, you might have a resource that requires authentication. If that's the case, the controller has a more obvious role.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: