Sha256: a61a6cbf23b5024f2d34115685b17502edbfad4a7d550f3573fe15447b1d6fe7

Contents?: true

Size: 548 Bytes

Versions: 2

Compression:

Stored size: 548 Bytes

Contents

module Bhf
  module FrontendHelper

    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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
bhf-0.6.22 app/helpers/bhf/frontend_helper.rb
bhf-0.6.21 app/helpers/bhf/frontend_helper.rb