Sha256: ef353aa14872b0add885d2a93ba01ef88c824a335c9d0a8b756a380199ab2e20

Contents?: true

Size: 413 Bytes

Versions: 1

Compression:

Stored size: 413 Bytes

Contents

module RailsContrib
  module ActionView
    module Base

      def conditional_tag(tag, condition, options=nil, &block)
        condition ? content_tag(tag, options, &block) : capture(&block)
      end

      def active_menu?(path)
        if path == '/'
          request.path == path ? 'active' : ''
        else
          request.path.start_with?(path) ? 'active' : ''
        end
      end

    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rails_contrib-0.0.2 lib/rails_contrib/action_view/base.rb