Sha256: ef5f4fb64ccfdb11ce2c06bae2f641ae99b350787afd67cc4959a6d68610d619

Contents?: true

Size: 819 Bytes

Versions: 4

Compression:

Stored size: 819 Bytes

Contents

ActionView::Base.class_eval do

  # name is ClassName of form you want
  # options are optional
  # options = {
  #   :internal_identifier => 'iid of exact form you want' (a model can have multiple forms)
  #   :width => 'width of form in pixels'
  # }
  def render_dynamic_form(name, options={})
    output = raw '&nbsp<script type="text/javascript">'
    output += raw "Compass.ErpApp.Utility.JsLoader.load(['/javascripts/erp_app/shared/dynamic_forms/dynamic_form_fields.js'], function(){"

    output += raw DynamicForm.get_form(name.to_s, options[:internal_identifier]).to_extjs_widget(
                { :url => build_widget_url(:new),
                  :widget_result_id => widget_result_id,
                  :width => options[:width] 
                })

    output += raw '});</script>'
    output
  end
  
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
erp_forms-2.0.6 lib/erp_forms/extensions/railties/action_view.rb
erp_forms-2.0.5 lib/erp_forms/extensions/railties/action_view.rb
erp_forms-2.0.4 lib/erp_forms/extensions/railties/action_view.rb
erp_forms-2.0.3 lib/erp_forms/extensions/railties/action_view.rb