Module: Lockdown::View::Rails
- Includes:
- Core
- Defined in:
- lib/lockdown/view.rb
Overview
Merb
Class Method Summary collapse
Instance Method Summary collapse
- #button_to(name, options = {}, html_options = nil) ⇒ Object
- #ld_link_to(name, options = {}, html_options = nil) ⇒ Object
- #link_to_or_show(name, options = {}, html_options = nil) ⇒ Object
Methods included from Core
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 (name, = {}, = nil) url = lock_down_url(, ) if url return (name,,) end return "" end |
#ld_link_to(name, options = {}, html_options = nil) ⇒ Object
37 38 39 40 41 42 43 |
# File 'lib/lockdown/view.rb', line 37 def ld_link_to(name, = {}, = nil) url = lock_down_url(, ) if url return rails_link_to(name,,) end return "" end |
#link_to_or_show(name, options = {}, html_options = nil) ⇒ Object
45 46 47 48 |
# File 'lib/lockdown/view.rb', line 45 def link_to_or_show(name, = {}, = nil) lnk = link_to(name, , ) lnk.length == 0 ? name : lnk end |