Sha256: 3ee8331be0c7421961c6b251d4754cfb577d332545de8a661843a3436faf2334

Contents?: true

Size: 540 Bytes

Versions: 6

Compression:

Stored size: 540 Bytes

Contents

module Bhf
  module ViewHelpers
    module ActionView

      def bhf_edit(object, options = {})
        return unless session[Bhf::Engine.config.session_auth_name.to_s] == true

        options[:platform_name] ||= object.class.to_s.pluralize.downcase
        
        if object.respond_to?(:'bhf_can_edit?', true)
          return unless object.bhf_can_edit?(options)
        end

        render :partial => 'bhf/helper/frontend_edit', :locals => { :platform_name => options[:platform_name], :object => object }
      end

    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
bhf-0.4.1 lib/bhf/view_helpers.rb
bhf-0.4.0 lib/bhf/view_helpers.rb
bhf-0.3.11 lib/bhf/view_helpers.rb
bhf-0.3.10 lib/bhf/view_helpers.rb
bhf-0.3.9 lib/bhf/view_helpers.rb
bhf-0.3.8 lib/bhf/view_helpers.rb