app/helpers/application_helper.rb
# universal remote form for root entity with or without associations.
# applicable to create, correct, update and destroy
universal remote form for root entity with or without associations.
applicable to create, correct, update and destroy
universal remote form for root entity with or without associations . applicable to create correct update and destroy
def universal_remote_form_for(entity, options = {}, &block)
    url_options = options[:url].blank? || options[:url][:action].blank? ? 
                  options[:url].to_h.merge(:action => "universal_put") : options[:url]
    url_options[:params] = url_options[:params].to_h.merge(:background_params => (@background_params || {}))
    opt = options.merge(:index  => entity.to_param,
                        :url    => url_options)
    opt[:html] ||= {}
    opt[:html].merge! :method => :post, :multipart =>  true
    remote_form_for( "_universal_attribute_", entity, opt, &block ) 
  end
def universal_remote_form_for ( entity , options = { } , & block ) url_options = options [ :url ] . blank? || options [ :url ] [ :action ] . blank? ? options [ :url ] . to_h . merge ( :action => "universal_put" ) : options [ :url ] url_options [ :params ] = url_options [ :params ] . to_h . merge ( :background_params => ( @background_params || { } ) ) opt = options . merge ( :index => entity . to_param , :url => url_options ) opt [ :html ] ||= { } opt [ :html ] . merge! :method => :post , :multipart => true remote_form_for ( "_universal_attribute_" , entity , opt , & block ) end
universal remote form for root entity with or without associations.
universal remote form for root entity with or without associations .
# set default action as "universal_put" # set method "post" and  multipart true
entity
<not_specific>
options
<not_specific>
block
<not_specific>