Class: BardStatic::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 BardStatic::LinkToHelper::LinkTo
Instance Attribute Details
#current_path ⇒ Object
Returns the value of attribute current_path.
66 67 68 |
# File 'app/helpers/bard_static/link_to_helper.rb', line 66 def current_path @current_path end |
Instance Method Details
#add_class(class_name) ⇒ Object
68 69 70 71 72 |
# File 'app/helpers/bard_static/link_to_helper.rb', line 68 def add_class class_name [:class] ||= "" [:class] << " #{class_name}" [:class].strip! end |
#current_condition ⇒ Object
79 80 81 |
# File 'app/helpers/bard_static/link_to_helper.rb', line 79 def current_condition .delete(:if) || current_path == url end |
#render ⇒ Object
74 75 76 77 |
# File 'app/helpers/bard_static/link_to_helper.rb', line 74 def render add_class("current") if current_condition super end |