Sha256: fe1b190f85318142d4b1661bb834f27042f06f499d693637d054823d9fc58ef9

Contents?: true

Size: 591 Bytes

Versions: 2

Compression:

Stored size: 591 Bytes

Contents

module Puffer
  module Controller
    module Helpers

      def self.included base
        base.class_eval do
          helper_method :resource_session, :puffer_navigation
        end
      end

      def puffer_navigation

      end

      def resource_session
        postfix = params[:action] =~ /associated_/ ? params[:action] : ''
        name = "#{current_resource.model_name}#{postfix}".to_sym
        session[:resources] ||= {}
        session[:resources][name] ||= {}
        session[:resources][name][:boolean] ||= {}
        session[:resources][name]
      end

    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
puffer-0.0.5 lib/puffer/controller/helpers.rb
puffer-0.0.4 lib/puffer/controller/helpers.rb