Module: Shipyard::LayoutHelper
- Defined in:
- app/helpers/shipyard/layout_helper.rb
Instance Method Summary collapse
- #current_action ⇒ Object
- #current_controller ⇒ Object
- #current_page ⇒ Object
- #current_route ⇒ Object
- #current_route_is?(routes) ⇒ Boolean
- #shipyard_css_classes ⇒ Object
Instance Method Details
#current_action ⇒ Object
15 16 17 |
# File 'app/helpers/shipyard/layout_helper.rb', line 15 def current_action controller.action_name.dasherize end |
#current_controller ⇒ Object
11 12 13 |
# File 'app/helpers/shipyard/layout_helper.rb', line 11 def current_controller controller.controller_name.dasherize end |
#current_page ⇒ Object
19 20 21 |
# File 'app/helpers/shipyard/layout_helper.rb', line 19 def current_page "#{current_controller}-#{current_action}" end |
#current_route ⇒ Object
23 24 25 |
# File 'app/helpers/shipyard/layout_helper.rb', line 23 def current_route "#{controller.controller_name}##{controller.action_name}" end |
#current_route_is?(routes) ⇒ Boolean
27 28 29 |
# File 'app/helpers/shipyard/layout_helper.rb', line 27 def current_route_is?(routes) routes.tr(' ', '').split(',').include? current_route end |
#shipyard_css_classes ⇒ Object
3 4 5 6 7 8 9 |
# File 'app/helpers/shipyard/layout_helper.rb', line 3 def shipyard_css_classes css_classes = [] css_classes << current_page css_classes << current_controller css_classes << "env-#{::Rails.env}" css_classes.join(' ') end |