How To: Ruby+Passenger+Sinatra


If you’re going to be making any real attempt at making your content look any nicer than a flat page of bleck then you’re going to be using layouts. Layouts let you nest content, and other templates into them by default.

If you try going for any page, unless you explicitly state TEMPLATE_ENGINE :PAGE, :layout => false then Sinatra will try to load layout.ext, where ext is the extension of whatever the current page’s template is written in.

Here’s ElectroCode’s layout’s in all three of the engines.


I may add more to this post at some point or I may just post another and reference it, but this is the gist of what is needed to get going with Ruby, Passenger, and Sinatra. If you have any questions about this page or anything on it, feel free to contact me via my contact channels and I’ll be sure to reply as soon as I can.

If you’ve gotten this far, thanks for reading. I spent around about eight hours writing this post up, and will gladly do it again if someone has a topic they would like me to write about.

Bye!  ^_^/

  ↑ Return to Top

Tagged , , , , , , , . Bookmark the permalink.

  • If this page or post could use some sprucing up, let us know by contacting us through this link