Module: Lockdown::Frameworks::Rails::View
- Defined in:
- lib/lockdown/frameworks/rails/view.rb
Class Method Summary collapse
Instance Method Summary collapse
- #button_to_secured(name, options = {}, html_options = nil) ⇒ Object
- #link_to_or_show(name, options = {}, html_options = nil) ⇒ Object
- #link_to_secured(name, options = {}, html_options = nil) ⇒ Object
- #links(*lis) ⇒ Object
Class Method Details
.included(base) ⇒ Object
5 6 7 8 9 10 11 12 13 |
# File 'lib/lockdown/frameworks/rails/view.rb', line 5 def self.included(base) base.class_eval do alias_method :link_to_open, :link_to alias_method :link_to, :link_to_secured alias_method :button_to_open, :button_to alias_method :button_to, :button_to_secured end end |
Instance Method Details
#button_to_secured(name, options = {}, html_options = nil) ⇒ Object
26 27 28 29 30 31 32 33 34 35 |
# File 'lib/lockdown/frameworks/rails/view.rb', line 26 def (name, = {}, = nil) url = url_for() method = ? [:method] : nil if (url, method) return (name, url, ) end return "" end |
#link_to_or_show(name, options = {}, html_options = nil) ⇒ Object
37 38 39 40 |
# File 'lib/lockdown/frameworks/rails/view.rb', line 37 def link_to_or_show(name, = {}, = nil) lnk = link_to(name, , ) lnk.length == 0 ? name : lnk end |
#link_to_secured(name, options = {}, html_options = nil) ⇒ Object
15 16 17 18 19 20 21 22 23 24 |
# File 'lib/lockdown/frameworks/rails/view.rb', line 15 def link_to_secured(name, = {}, = nil) url = url_for() method = ? [:method] : nil if (url, method) return link_to_open(name, url, ) end return "" end |