What is the easiest and most graceful way to auto-submit an AJAX form when a drop-down box's option is selected? I'm creating an administration page where the admin can modify user permissions (where "permissions" is stored as an integer), and I would like the "permissions" field to be a drop-down box that automatically submits and updat...
Hello, my question involves the following partial view with a remote form:
<% remote_form_for :phone_number, :url => {:controller => "edit", :action => "add_phone_number" }, :update => "phone_number_div" do |form| %>
<%= form.text_field :number%>
<%= form.select :type, PhoneNumber::PHONE_TYPE%>
<%= submit_tag "Add" %>
<% end %>
...
I'm trying to submit a rails form using a submit trigger that is outside of the form tags. So I have my form:
<% remote_form_for Package.new,
:url => { :action => :rate_shop, :ids_sales_order_id => params[:ids_sales_order_id],
:id => @shipment.id }, :loading => '$("#loading").overlay({api: true}).load(); ' + visual_effect(:appear, 'pri...
This is what I've used with remote_form_tag:
<% form_remote_tag(:url => {:controller => '/companies', :action => 'update'},
:update => 'tags') do %>
<%= text_field :company, :tag_list %>
<%= submit_tag 'Save' %>
<% end %>
This is in a Company.view, where Company is a model that is acts_as_taggable_on enabled.
...