Module: Lockdown::View::Merb
- Includes:
- Core
- Defined in:
- lib/lockdown/view.rb
Overview
Core
Class Method Summary collapse
Instance Method Summary collapse
- #link_to(name, url = '', options = {}) ⇒ Object
- #link_to_or_show(name, url = '', options = {}) ⇒ Object
Methods included from Core
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
#link_to(name, url = '', options = {}) ⇒ Object
17 18 19 20 21 22 |
# File 'lib/lockdown/view.rb', line 17 def link_to(name, url = '', = {}) if url return merb_link_to(name, url, ) end return "" end |
#link_to_or_show(name, url = '', options = {}) ⇒ Object
24 25 26 27 |
# File 'lib/lockdown/view.rb', line 24 def link_to_or_show(name, url = '', = {}) lnk = link_to(name, , ) lnk.length == 0 ? name : lnk end |