lib/darkext/sinatra.rb in darkhelmet-darkext-0.9.0 vs lib/darkext/sinatra.rb in darkhelmet-darkext-0.9.2
- old
+ new
@@ -5,20 +5,12 @@
html = haml(view,options)
flash.clear
html
end
- def partial(template, options = {})
- options.merge!(:layout => false)
- if collection = options.delete(:collection) then
- collection.inject([]) do |buffer, member|
- buffer << haml(template, options.merge(:layout => false,
- :locals => {template.to_sym => member}))
- end.join("\n")
- else
- haml(template, options)
- end
+ def partial(view, options = {})
+ haml(view,options.merge(:layout => false))
end
def css_link_tag(sheet, media = 'screen,projection')
partial("%link{ :type => 'text/css', :href => '#{options.slash ? '/' : ''}stylesheets/#{sheet}.css', :rel => 'stylesheet', :media => '#{media}' }")
end
@@ -59,9 +51,13 @@
@title = "#{options.site_name} - #{extra}"
end
def base
host + options.site_base
+ end
+
+ def redirect_back
+ redirect(request.env['HTTP_REFERER'])
end
end
def self.registered(app)
app.helpers HelperMethods