maxjustus / sinatra-authentication

A sinatra extension wrapped in a gem that implements authentication/permissions with users stored in the database. Now with optional support for facebook connect
The Unlicense
476 stars 94 forks source link

Overriding template engine not possible #55

Closed simonszu closed 6 years ago

simonszu commented 11 years ago

Hi,

i have designed my sinatra app as a standalone-app and not as a subclass of Sinatra::Application. However, the setting for overriding the template engine from haml to erb is not working for me. I have made the setting

configure do
   set :template_engine, :erb
end

and still get the following error:

LoadError at /login cannot load such file -- haml

scouttyg commented 11 years ago

I had the same problem, and had to pull straight from the git repo in order to fix it, as I believe its fixed in 0.4.2, but rubygems is still on 0.4.1 (probably because there are still references to 0.4.1 in the code)

Try this instead:

gem 'sinatra-authentication', :git => 'git://github.com/maxjustus/sinatra-authentication.git'

You'll also need to provide the erb files, since they aren't included in the gem. So that means you'll probably have to add this line as well:

set :sinatra_authentication_view_path, Pathname(__FILE__).dirname.expand_path + "my_views/"

Where "my_views" is the folder where you're views are located in the root directory of the app.