forked from padrino/padrino-framework
/
app.rb.tt
38 lines (33 loc) · 1.66 KB
/
app.rb.tt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
module <%= @app_name %>
class Admin < Padrino::Application
register Padrino::Rendering
register Padrino::Mailer
register Padrino::Helpers
register Padrino::Admin::AccessControl
##
# Application configuration options
#
# set :raise_errors, true # Raise exceptions (will stop application) (default for test)
# set :dump_errors, true # Exception backtraces are written to STDERR (default for production/development)
# set :show_exceptions, true # Shows a stack trace in browser (default for development)
# set :logging, true # Logging in STDOUT for development and file for production (default only for development)
# set :public_folder, "foo/bar" # Location for static assets (default root/public)
# set :reload, false # Reload application files (default in development)
# set :default_builder, "foo" # Set a custom form builder (default 'StandardFormBuilder')
# set :locale_path, "bar" # Set path for I18n translations (default your_app/locales)
# disable :sessions # Disabled sessions by default (enable if needed)
# disable :flash # Disables sinatra-flash (enabled by default if Sinatra::Flash is defined)
# layout :my_layout # Layout can be in views/layouts/foo.ext or views/foo.ext (default :application)
#
set :admin_model, '<%= @model_name %>'
set :login_page, "/admin/sessions/new"
enable :sessions
disable :store_location
access_control.roles_for :any do |role|
role.protect '/'
role.allow '/sessions'
end
access_control.roles_for :admin do |role|
end
end
end