Module: Lockdown::View::Merb

Includes:
Core
Defined in:
lib/lockdown/view.rb

Overview

Core

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Core

#links

Class Method Details

.included(base) ⇒ Object



13
14
15
# File 'lib/lockdown/view.rb', line 13

def self.included(base)
  base.send :alias_method, :merb_link_to,  :link_to
end

Instance Method Details



17
18
19
20
21
22
# File 'lib/lockdown/view.rb', line 17

def link_to(name, url = '', options = {})
  if authorized? url
    return merb_link_to(name, url, options)
  end
  return ""
end


24
25
26
27
# File 'lib/lockdown/view.rb', line 24

def link_to_or_show(name, url = '', options = {})
				lnk = link_to(name, options, html_options)
				lnk.length == 0  ? name : lnk
end