Sha256: ced804d3bdea182e43d10c4f4f4897e48c3350f3b5c575aac5156e496b78f0a5

Contents?: true

Size: 1.3 KB

Versions: 69

Compression:

Stored size: 1.3 KB

Contents

require 'promethee'

module ActionView
  module Helpers
    module Tags
      # https://github.com/rails/rails/blob/bdc581616b760d1e2be3795c6f0f3ab4b1e125a5/actionview/lib/action_view/helpers/tags/text_field.rb
      class PrometheeEditor < Base
        def render
          @options[:master_data] = object.send @method_name unless object.nil?
          @options[:master_data] = @options[:value] if @options.key?(:value)
          ApplicationController.renderer.render partial: 'promethee/edit', locals: @options
        end
      end

      class PrometheeLocalizer < Base
        def render
          localization_data = object.send @method_name unless object.nil?
          localization_data = @options[:value] if @options.include? :value
          master_data = @options[:master]
          ApplicationController.renderer.render partial: 'promethee/localize',
                                                locals: {
                                                  object_name: @object_name,
                                                  method_name: @method_name,
                                                  localization_data: localization_data,
                                                  master_data: master_data
                                                }
        end
      end
    end
  end
end

Version data entries

69 entries across 69 versions & 1 rubygems

Version Path
promethee-1.6.63 lib/promethee/core_ext/tags.rb
promethee-1.6.62 lib/promethee/core_ext/tags.rb
promethee-1.6.61 lib/promethee/core_ext/tags.rb
promethee-1.6.60 lib/promethee/core_ext/tags.rb
promethee-1.6.59 lib/promethee/core_ext/tags.rb
promethee-1.6.58 lib/promethee/core_ext/tags.rb
promethee-1.6.57 lib/promethee/core_ext/tags.rb
promethee-1.6.56 lib/promethee/core_ext/tags.rb
promethee-1.6.55 lib/promethee/core_ext/tags.rb
promethee-1.6.54 lib/promethee/core_ext/tags.rb
promethee-1.6.53 lib/promethee/core_ext/tags.rb
promethee-1.6.52 lib/promethee/core_ext/tags.rb
promethee-1.6.51 lib/promethee/core_ext/tags.rb
promethee-1.6.50 lib/promethee/core_ext/tags.rb
promethee-1.6.49 lib/promethee/core_ext/tags.rb
promethee-1.6.48 lib/promethee/core_ext/tags.rb
promethee-1.6.47 lib/promethee/core_ext/tags.rb
promethee-1.6.46 lib/promethee/core_ext/tags.rb
promethee-1.6.45 lib/promethee/core_ext/tags.rb
promethee-1.6.44 lib/promethee/core_ext/tags.rb