Class: Bard::Static::LinkToHelper::LinkToCurrent
- Defined in:
- app/helpers/bard/static/link_to_helper.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#current_path ⇒ Object
Returns the value of attribute current_path.
Attributes inherited from LinkTo
#context, #html_options, #name, #options
Instance Method Summary collapse
Methods inherited from LinkTo
Constructor Details
This class inherits a constructor from Bard::Static::LinkToHelper::LinkTo
Instance Attribute Details
#current_path ⇒ Object
Returns the value of attribute current_path.
68 69 70 |
# File 'app/helpers/bard/static/link_to_helper.rb', line 68 def current_path @current_path end |
Instance Method Details
#add_class(class_name) ⇒ Object
70 71 72 73 74 |
# File 'app/helpers/bard/static/link_to_helper.rb', line 70 def add_class class_name [:class] ||= "" [:class] << " #{class_name}" [:class].strip! end |
#current_condition ⇒ Object
81 82 83 |
# File 'app/helpers/bard/static/link_to_helper.rb', line 81 def current_condition .delete(:if) || current_path == url end |
#render ⇒ Object
76 77 78 79 |
# File 'app/helpers/bard/static/link_to_helper.rb', line 76 def render add_class("current") if current_condition super end |