The problem is that I have a hard time figuring out how to organize my
controllers. Let’s say I want to add a commenting system (controller
comment). This would then result in ww.site.com/comment although I
want i to be www.site.be/nameofrestaurant/comment where all the
comment actions taken are related to nameofrestaurant.
I actually want one code base without the need to copy my code for
every restaurant that gets added. Is this possible?
There is no need to make the controller for the comments, just make the
controllers according to your restaurants and define comments action in
every controller (related restaurants) so that when there is any comment
about the restaurant, information will be displayed like www.domain.com/your_controller_name/comments means www.domain.com/restaurant_name/comments
The problem is that I have a hard time figuring out how to organize my
controllers. Let’s say I want to add a commenting system (controller
comment). This would then result in ww.site.com/comment although I
want i to be www.site.be/nameofrestaurant/comment where all the
comment actions taken are related to nameofrestaurant.
This is the perfect place to take advantage of Rails 1.2’s RESTful
features.