Sha256: 9c67d60c4f0d58801edd02892cfaf94ca95f6bf0398d561d2e4904c97f2fbba3

Contents?: true

Size: 587 Bytes

Versions: 11

Compression:

Stored size: 587 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

11 entries across 11 versions & 1 rubygems

Version Path
bhf-0.4.9 lib/bhf/view_helpers.rb
bhf-0.4.8 lib/bhf/view_helpers.rb
bhf-0.4.7 lib/bhf/view_helpers.rb
bhf-0.4.6 lib/bhf/view_helpers.rb
bhf-0.4.5 lib/bhf/view_helpers.rb
bhf-0.4.4 lib/bhf/view_helpers.rb
bhf-0.4.3 lib/bhf/view_helpers.rb
bhf-0.4.2.7 lib/bhf/view_helpers.rb
bhf-0.4.2.5 lib/bhf/view_helpers.rb
bhf-0.4.2.4 lib/bhf/view_helpers.rb
bhf-0.4.2.3 lib/bhf/view_helpers.rb