Sha256: 2d8faa888e731a1a38c9e9f964f52eac00222a38525345dc961981f3e354d633

Contents?: true

Size: 599 Bytes

Versions: 3

Compression:

Stored size: 599 Bytes

Contents

module Bhf
  module ViewHelpers
    module ActionView

      def bhf_edit(object, options = {}) # TODO: block of html for custom editing buttons and links
        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

3 entries across 3 versions & 1 rubygems

Version Path
bhf-0.4.2.2 lib/bhf/view_helpers.rb
bhf-0.4.2.1 lib/bhf/view_helpers.rb
bhf-0.4.2 lib/bhf/view_helpers.rb