Module: Lockdown::View::Rails

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

Overview

Merb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Core

#links

Class Method Details

.included(base) ⇒ Object



32
33
34
35
# File 'lib/lockdown/view.rb', line 32

def self.included(base)
   base.send :alias_method, :rails_link_to,  :link_to
   base.send :alias_method, :rails_button_to,  :button_to
end

Instance Method Details

#button_to(name, options = {}, html_options = nil) ⇒ Object



51
52
53
54
55
56
57
# File 'lib/lockdown/view.rb', line 51

def button_to(name, options = {}, html_options = nil)
  url = lock_down_url(options, html_options)
  if authorized? url
    return rails_button_to(name,options,html_options)
  end
  return ""
end


37
38
39
40
41
42
43
# File 'lib/lockdown/view.rb', line 37

def ld_link_to(name, options = {}, html_options = nil)
  url = lock_down_url(options, html_options)
  if authorized? url
    return rails_link_to(name,options,html_options)
  end
  return ""
end


45
46
47
48
# File 'lib/lockdown/view.rb', line 45

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