Camping interprets every request to the server using the paths in the controllers, so if you want to serve static files, like external stylesheets or images, you need to provide a controller for them. Take this bit of Markaby:
img :src => 'images/logo.png'
This will get interpreted by Camping and end up with this HTML:
<img src="images/logo.png">
When the browser reads that, it will send a GET request to the Camping server looking for logo.png, that Camping will try to match against the controller paths. If you haven't set one up, you'll get an error.
So, in your Controllers module:
class StaticImage < R '/images/(.*)' def get(static_name) current_dir = File.expand_path(File.dirname(<strong>FILE</strong>)) @headers['Content-Type'] = "image/png" @headers['X-Sendfile'] = "#{current_dir}/images/#{static_name}" end end
and in your View module, create the link like this:
img :src => R(StaticImage, 'logo.png')
Shake and bake for any kind of static resource you want to send.