Class: Site
- Inherits:
-
Merb::Controller
- Object
- Merb::Controller
- Site
- Defined in:
- lib/staticmatic/merb/site.rb
Overview
Intercept all requests
Instance Method Summary collapse
- #asset_path(*args) ⇒ Object
- #image_tag(img, opts = {}) ⇒ Object
- #index ⇒ Object
- #link_to(name, url = '', opts = {}) ⇒ Object
- #partial(template, opts = {}) ⇒ Object
Instance Method Details
#asset_path(*args) ⇒ Object
13 14 15 |
# File 'lib/staticmatic/merb/site.rb', line 13 def asset_path(*args) relative_path(super) end |
#image_tag(img, opts = {}) ⇒ Object
18 19 20 |
# File 'lib/staticmatic/merb/site.rb', line 18 def image_tag(img, opts={}) super(img, opts.merge(:path => relative_path('/images/'))) end |
#index ⇒ Object
3 4 5 |
# File 'lib/staticmatic/merb/site.rb', line 3 def index render :template => current_page end |
#link_to(name, url = '', opts = {}) ⇒ Object
23 24 25 26 27 |
# File 'lib/staticmatic/merb/site.rb', line 23 def link_to(name, url='', opts={}) absolute_path = (opts[:href] || url) absolute_path = "/" + absolute_path if absolute_path.length > 0 super(name, url, opts.merge(:href => relative_path(absolute_path))) end |
#partial(template, opts = {}) ⇒ Object
8 9 10 |
# File 'lib/staticmatic/merb/site.rb', line 8 def partial(template, opts={}) super(template.to_s, opts) end |