Module: Flms::ApplicationHelper
- Defined in:
- app/helpers/flms/application_helper.rb
Instance Method Summary collapse
-
#block_thumbnail_div_background_style(block) ⇒ Object
Get a background-image style for the specified block.
-
#nav_active_class(controller_path) ⇒ Object
Return ‘active’ if the current request is to the specified controller, otherwise return an empty string.
Instance Method Details
#block_thumbnail_div_background_style(block) ⇒ Object
Get a background-image style for the specified block. If the block doesn’t have a thumbnail, return an empty string.
12 13 14 |
# File 'app/helpers/flms/application_helper.rb', line 12 def block_thumbnail_div_background_style block block.thumbnail? ? "background-image: url(#{ block.thumbnail.small.url })" : '' end |
#nav_active_class(controller_path) ⇒ Object
Return ‘active’ if the current request is to the specified controller, otherwise return an empty string.
6 7 8 |
# File 'app/helpers/flms/application_helper.rb', line 6 def nav_active_class controller_path params[:controller] == controller_path ? 'active' : '' end |