Sha256: 850d79853dee21996a286b45e8d8970d7b753bde263734e5cb7dec65aa78c223

Contents?: true

Size: 593 Bytes

Versions: 50

Compression:

Stored size: 593 Bytes

Contents

module Bhf
  module ViewHelpers
    module ActionView

      def bhf_edit(object, options = {}) # TODO: add a 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

50 entries across 50 versions & 1 rubygems

Version Path
bhf-0.6.15 lib/bhf/view_helpers.rb
bhf-0.6.14 lib/bhf/view_helpers.rb
bhf-0.6.13 lib/bhf/view_helpers.rb
bhf-0.6.12 lib/bhf/view_helpers.rb
bhf-0.6.11 lib/bhf/view_helpers.rb
bhf-0.6.10 lib/bhf/view_helpers.rb
bhf-0.6.6 lib/bhf/view_helpers.rb
bhf-0.6.5 lib/bhf/view_helpers.rb
bhf-0.6.4 lib/bhf/view_helpers.rb
bhf-0.6.3 lib/bhf/view_helpers.rb
bhf-0.6.2 lib/bhf/view_helpers.rb
bhf-0.6.1 lib/bhf/view_helpers.rb
bhf-0.6.0 lib/bhf/view_helpers.rb
bhf-0.5.13 lib/bhf/view_helpers.rb
bhf-0.5.12 lib/bhf/view_helpers.rb
bhf-0.5.11 lib/bhf/view_helpers.rb
bhf-0.5.10 lib/bhf/view_helpers.rb
bhf-0.5.9 lib/bhf/view_helpers.rb
bhf-0.5.8 lib/bhf/view_helpers.rb
bhf-0.5.7 lib/bhf/view_helpers.rb