Sha256: 83a63b27a5147b500e7a73482d5021a5fcfb918bc8ab01200f5f68a917ce5c6c

Contents?: true

Size: 728 Bytes

Versions: 4

Compression:

Stored size: 728 Bytes

Contents

class <%= @name.camelcase %>::Application
  before do
    content_type 'text/html'
  end

  set :sessions, true
  set :views, Proc.new { File.join(root, "/app/views") }

  configure do
    enable :logging
    enable :static_cache_control
    file = File.new("#{root}/log/#{environment.to_s}.log", 'a+')

    <%- unless @no_database || @database == 'mongodb' || @database == 'mongo' -%>
    ActiveRecord::Base.logger = Logger.new(file)
    <%- end -%>

    file.sync = true
    use Rack::CommonLogger, file

    # set CSRF
    # use Rack::Session::Cookie, secret: $app_settings["csrf_token"]
    # use Rack::Csrf, :raise => true

    # set layouts
    set :erb, :layout => :'layouts/application', :escape_html => true
  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
aetherg-0.2.2 lib/templates/config/initializers/environment.rb
aetherg-0.2.1 lib/templates/config/initializers/environment.rb
aetherg-0.2.0 lib/templates/config/initializers/environment.rb
aetherg-0.1.8 lib/templates/config/initializers/environment.rb