Sha256: 648edeb52b3908f2d852b009d55311fe440dc4983831209a009ceb03041191f2

Contents?: true

Size: 553 Bytes

Versions: 2

Compression:

Stored size: 553 Bytes

Contents

module Flms
  module ApplicationHelper

    # Return 'active' if the current request is to the specified controller,
    # otherwise return an empty string.
    def nav_active_class controller_path
      params[:controller] == controller_path ? 'active' : ''
    end

    # Get a background-image style for the specified block.
    # If the block doesn't have a thumbnail, return an empty string.
    def block_thumbnail_div_background_style block
      block.thumbnail? ? "background-image: url(#{ block.thumbnail.small.url })" : ''
    end

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
flms-0.9.0 app/helpers/flms/application_helper.rb
flms-0.1.0 app/helpers/flms/application_helper.rb