Sha256: 0cf1490811e9a08f339209cf65cf35b5524c9f64eb9f28a7c037f643d5093ce9

Contents?: true

Size: 448 Bytes

Versions: 9

Compression:

Stored size: 448 Bytes

Contents

module YariiEditor
  module EditorHelper
    def add_field(type, props)
      render "yarii_editor/editor/#{type}", props
    end

    def name_from_variable(props)
      model_name = params[:content_model]
      "#{model_name}[#{props[:variable]}]" || "unknown#{(1..10000).to_a.sample}"
    end

    def value_from_variable(props)
      variable = props[:variable]
      if variable && @doc
        @doc.send(variable)
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
yarii-editor-0.4.8 app/helpers/yarii_editor/editor_helper.rb
yarii-editor-0.4.7 app/helpers/yarii_editor/editor_helper.rb
yarii-editor-0.4.6 app/helpers/yarii_editor/editor_helper.rb
yarii-editor-0.4.5 app/helpers/yarii_editor/editor_helper.rb
yarii-editor-0.4.4 app/helpers/yarii_editor/editor_helper.rb
yarii-editor-0.4.3 app/helpers/yarii_editor/editor_helper.rb
yarii-editor-0.4.2 app/helpers/yarii_editor/editor_helper.rb
yarii-editor-0.4.1 app/helpers/yarii_editor/editor_helper.rb
yarii-editor-0.4.0 app/helpers/yarii_editor/editor_helper.rb