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.
72 73 74 |
# File 'app/helpers/bard/static/link_to_helper.rb', line 72 def current_path @current_path end |
Instance Method Details
#add_class(class_name) ⇒ Object
74 75 76 77 78 |
# File 'app/helpers/bard/static/link_to_helper.rb', line 74 def add_class class_name [:class] ||= "" [:class] += " #{class_name}" [:class].strip! end |
#current_condition ⇒ Object
85 86 87 |
# File 'app/helpers/bard/static/link_to_helper.rb', line 85 def current_condition .delete(:if) || current_path == url end |
#render ⇒ Object
80 81 82 83 |
# File 'app/helpers/bard/static/link_to_helper.rb', line 80 def render add_class("current") if current_condition super end |