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
- #remove_subdirectory(url) ⇒ 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
28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/lockdown/frameworks/rails/view.rb', line 28 def (name, = {}, = nil) url = url_for() method = ? [:method] : nil = remove_subdirectory(url) if (, method) return (name, url, ) end return "" end |
#link_to_or_show(name, options = {}, html_options = nil) ⇒ Object
41 42 43 44 |
# File 'lib/lockdown/frameworks/rails/view.rb', line 41 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 25 26 |
# File 'lib/lockdown/frameworks/rails/view.rb', line 15 def link_to_secured(name, = {}, = nil) url = url_for() method = ? [:method] : nil = remove_subdirectory(url) if (, method) return link_to_open(name, url, ) end return "" end |