Sha256: fe641b68215486a3597af89ce7cf91b313de469847e33199066a4f8205e4dc3a

Contents?: true

Size: 1.56 KB

Versions: 42

Compression:

Stored size: 1.56 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)
          @options[:disable_page_attributes] ||= false
          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
          @options[:disable_page_attributes] ||= false
          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],
                                                  disable_page_attributes: @options[:disable_page_attributes]
                                                }
        end
      end
    end
  end
end

Version data entries

42 entries across 42 versions & 1 rubygems

Version Path
promethee-4.1.12 lib/promethee/core_ext/tags.rb
promethee-4.1.11 lib/promethee/core_ext/tags.rb
promethee-4.1.10 lib/promethee/core_ext/tags.rb
promethee-4.1.9 lib/promethee/core_ext/tags.rb
promethee-4.1.8 lib/promethee/core_ext/tags.rb
promethee-4.1.7 lib/promethee/core_ext/tags.rb
promethee-4.1.6 lib/promethee/core_ext/tags.rb
promethee-4.1.5 lib/promethee/core_ext/tags.rb
promethee-4.1.4 lib/promethee/core_ext/tags.rb
promethee-4.1.3 lib/promethee/core_ext/tags.rb
promethee-4.1.2 lib/promethee/core_ext/tags.rb
promethee-4.1.1 lib/promethee/core_ext/tags.rb
promethee-4.1.0 lib/promethee/core_ext/tags.rb
promethee-4.0.8 lib/promethee/core_ext/tags.rb
promethee-4.0.7 lib/promethee/core_ext/tags.rb
promethee-4.0.6 lib/promethee/core_ext/tags.rb
promethee-4.0.5 lib/promethee/core_ext/tags.rb
promethee-4.0.4 lib/promethee/core_ext/tags.rb
promethee-4.0.3 lib/promethee/core_ext/tags.rb
promethee-4.0.2 lib/promethee/core_ext/tags.rb