Class: Site

Inherits:
Merb::Controller
  • Object
show all
Defined in:
lib/staticmatic/merb/site.rb

Overview

Intercept all requests

Instance Method Summary collapse

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

#indexObject



3
4
5
# File 'lib/staticmatic/merb/site.rb', line 3

def index
  render :template => current_page
end


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