Sha256: c1e7c524e878db75362f1d556be8b01ce8a8e6a7bfa02bebbe67f083c53fdcc5

Contents?: true

Size: 1.34 KB

Versions: 56

Compression:

Stored size: 1.34 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
          ApplicationController.renderer.render partial: 'promethee/localize',
                                                locals: {
                                                  object_name: @object_name,
                                                  method_name: @method_name,
                                                  localization_data: localization_data,
                                                  master_data: @options[:master],
                                                  other_data: @options[:other]
                                                }
        end
      end
    end
  end
end

Version data entries

56 entries across 56 versions & 1 rubygems

Version Path
promethee-1.8.2 lib/promethee/core_ext/tags.rb
promethee-1.8.1 lib/promethee/core_ext/tags.rb
promethee-1.8.0 lib/promethee/core_ext/tags.rb
promethee-1.7.12 lib/promethee/core_ext/tags.rb
promethee-1.7.11 lib/promethee/core_ext/tags.rb
promethee-1.7.10 lib/promethee/core_ext/tags.rb
promethee-1.7.9 lib/promethee/core_ext/tags.rb
promethee-1.7.8 lib/promethee/core_ext/tags.rb
promethee-1.7.7 lib/promethee/core_ext/tags.rb
promethee-1.7.6 lib/promethee/core_ext/tags.rb
promethee-1.7.5 lib/promethee/core_ext/tags.rb
promethee-1.7.4 lib/promethee/core_ext/tags.rb
promethee-1.7.3 lib/promethee/core_ext/tags.rb
promethee-1.7.2 lib/promethee/core_ext/tags.rb
promethee-1.7.1 lib/promethee/core_ext/tags.rb
promethee-1.7.0 lib/promethee/core_ext/tags.rb