Sinatra Gems and Frameworks You Should Know About

Padrino

The godfather of Sinatra. Those who like Rails will probably want to start with Padrino rather than just bare-bones Sinatra DSL. Check out the blog tutorial.

This entire blog in Sinatra has about 200 lines of code and uses various gems. It is very simple because I like simplicity and I believe there are just a lot of things about Wordpress which I do not need.

Gems you might want to use:

Carrierwave

An alternative to Paperclip for uploading images for Rails apps. It is framework-agnostic so you can use it for Sinatra apps.

Rack Flash

Missing flash notices in Rails? You’ll definitely need this one.

on your app:

post '/sing' do

  flash[:notice]  = "Post has been created."

end

on your views or layout:

<% if flash[:notice] %>
  <div class="notice"><%= flash[:notice] %></div>
<% end %>

Pony

Pony is used for sending email much like ActionMailer in Rails.

Stringex

For clean url’s. I have a lot of posts about google-friendly links and I wrote about friendly id which is used by nearly every Rails developer in the world. I do feel, however, the advantages of just using Stringex. Imagine having better queries if your slug isn’t found on different table. It’s a lot faster that way.

If any one of you have heard about Rails Plugins site which is dedicated to finding out which gems work for Rails3, I think there should be a site for Rubyists in general wherein Ruby programmers, Gem developers and users can discuss whether gems work for a specific framework. There are DSL’s other than Sinatra. And for me there’s nothing wrong with that as long as we have a way of knowing what works and what doesn’t work for the DSL.