Hi,
If you're using sprockets with Sinatra, the serenade.rb gem allows you to easily integrate Serenade into your sprockets environment. Check the docs.
If you're looking for a more Vanilla approach, there are several ways you can do this:
1) Integrate Serenade into your build process. This is the option I prefer, you add a compilation step which compiles a serenade view file into a js file and then concats it with the rest of your JavaScript. This is the approach taken by serenade.rb, it makes this process really easy. I'm not sure what options you have with other build systems, such as Grunt, Brunch or lineman, you'll have to dig around.
2) Put the template in a <script> tag in your HTML. This is the approach that Ember for example seems to favour. I personally don't really like it. It makes your HTML very bloated. Loading the template is pretty easy then, just do something like:
[].forEach.call(document.querySelectorAll("script[type=text/serenade]"), function(tag) {
Serenade.view(tag.getAttribute("id"), tag.innerHTML)
})
Or something like that, that's just off the top of my head. This is surely the simplest solution.
3) Inline your views in your javascript. Ugh. Pretty ugly. It's slightly better if you're using CoffeeScript, as it at least supports decent multi-line strings. Still not nice.
4) Load your views via AJAX. Depending on your app this might make sense, but it might not scale.
Hope that gives you some starting points. Let me know if you need more assistance.
/Jonas