Sha256: 77a3ca288ecb5fe8ee6116dad1247c35b8b62e782802b11a2552529be16b9c05
Contents?: true
Size: 840 Bytes
Versions: 5
Compression:
Stored size: 840 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 ' <script type="text/javascript">Ext.onReady(function() {' output += raw "new OnDemandLoadByAjax().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
5 entries across 5 versions & 1 rubygems