Module: Editor::PropertiesBuilderHelper

Includes:
Mercury::Authentication
Defined in:
app/helpers/amalgam/editor/properties_builder_helper.rb

Defined Under Namespace

Classes: PropertyFormBuilder

Instance Method Summary collapse

Instance Method Details

#properties_for(record, options = {}, &proc) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'app/helpers/amalgam/editor/properties_builder_helper.rb', line 4

def properties_for(record, options = {}, &proc)
  return unless can_edit?
  defaults = {
    :builder => PropertyFormBuilder,
    :url => amalgam.admin_editor_path,
    :method => :put,
    :remote => true,
    :html => { :style => 'width:450px;padding-bottom:30px;' }
  }

  options.reverse_merge!(defaults)
  form = form_for(record,options) do |f|
    yield(f)
    concat('<hr/>'.html_safe)
    concat(f.submit(:class => 'btn btn-primary'))
  end
  (:script, form , :type => "text/html" ,:id => 'property-form')
end