lib/letter_opener/web/app.rb in letter_opener-web-0.1.2 vs lib/letter_opener/web/app.rb in letter_opener-web-0.2.0
- old
+ new
@@ -9,16 +9,22 @@
set :public_folder, Proc.new { "#{root}/assets" }
set :views, Proc.new { "#{root}/views" }
enable :method_override
- if defined?(Padrino)
+ if defined?(Padrino) && Padrino.version < '0.13.0'
def self.setup_application!; end
def self.dependencies; []; end
def self.reload!; end
set :app_name, :letter_opener
if Padrino.version < '0.12.0'
set :erb, :engine_class => Padrino::Erubis::SafeBufferTemplate
+ end
+ end
+
+ helpers do
+ def h(text)
+ Rack::Utils.escape_html(text)
end
end
def root_path
"#{env['SCRIPT_NAME']}/"