I am trying to make my first application using REST and I am trying to
embrace the CRUD!
However I am coming accross some difficulties.
In my database I have a table called "contents" and this has a
content_type field. So this way I can recognise if it is a blog,
article, event etc. They all share the same structure, so there is not
need to make three tabels.
I first thought that I would need to create three controllers
(articles_controller, blogs_controller and events_controller) to only
use REST/CRUD. However I cannot do this because of the route
defination of map.resources :content
What is the best way to do this using REST ? Have one controller named
content and just check the content_type in the params ? If that is the
case then how would I pass this param value in the url and configure
routes to work nicely ?
Thanks in advance.