Small Apps, Many Mounts
Rather than building huge Camping apps, the idea here is to write small apps which can each be mounted at directories on your web server. One restriction: these apps will share a database. However, this allows applications to access each other's tables and simplifies setup and configuration.
The camping tool starts a web server which mounts apps in this fashion. If you want to mount all the examples, run camping examples/**/*.rb.
You'll end up with:
- http://localhost:3301/blog, the blogging sample app.
- http://localhost:3301/tepee, the wiki sample app.
- http://localhost:3301/charts, the charting sample app.
In your app, if you're using the R() method to build your links, Camping will make sure the mount is added properly to links.
For example, if R(View, 1) is used in the blogging app mounted at /blog, the link will be written as /blog/view/1. If later you mount the blog at /articles instead, Camping will write the link as /articles/view/1.
Return to CampingRulesOfThumb
