Sha256: 05b087fd90b5303c264c352f57fbfc544ee0ed289c6935a7d9121aa07478e84f

Contents?: true

Size: 609 Bytes

Versions: 1

Compression:

Stored size: 609 Bytes

Contents

module MicroSessions
  module Helpers
    module UrlHelper
      extend ActiveSupport::Concern

      def url_for(options = {})
        if options.is_a?(Hash) && ms_value = options.delete(:micro_sessions) && !micro_session.empty?
          options[micro_session.options[:param]] = (ms_value == true ? micro_session.id : ms_value)
        end
      
        super
      end
    end
    
    module FormTagHelper
      extend ActiveSupport::Concern
      
      def micro_session_hidden_field
        hidden_field_tag controller.class.micro_session_options[:param], micro_session.id
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
micro_sessions-0.2.0 lib/micro_sessions/helpers.rb