Sinatra

edit by double-clicking content
edit this page

FAQ

How do I use Partials?

Put the following code in your main app file:

    helpers do
      def partial(name, options={})
        haml(name, options.merge(:layout => false))
      end
    end

Then, in your template, the following would render “my_partial.haml” inline:

= partial(:my_partial)