Sha256: ee95b736b307cf0fe44f1478235aea9041517299f926d6ff29799bb069c14375

Contents?: true

Size: 1.3 KB

Versions: 12

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
          master_data = object.send @method_name unless object.nil?
          master_data = @options[:value] if @options.include? :value
          ApplicationController.renderer.render partial: 'promethee/edit', locals: { master_data: master_data }
        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

12 entries across 12 versions & 1 rubygems

Version Path
promethee-1.3.21 lib/promethee/core_ext/tags.rb
promethee-1.3.20 lib/promethee/core_ext/tags.rb
promethee-1.3.19 lib/promethee/core_ext/tags.rb
promethee-1.3.18 lib/promethee/core_ext/tags.rb
promethee-1.3.17 lib/promethee/core_ext/tags.rb
promethee-1.3.16 lib/promethee/core_ext/tags.rb
promethee-1.3.15 lib/promethee/core_ext/tags.rb
promethee-1.3.13 lib/promethee/core_ext/tags.rb
promethee-1.3.12 lib/promethee/core_ext/tags.rb
promethee-1.3.11 lib/promethee/core_ext/tags.rb
promethee-1.3.10 lib/promethee/core_ext/tags.rb
promethee-1.3.9 lib/promethee/core_ext/tags.rb