I use form_remote_tag and text_field_tag to send select scope to controller.
It returns a long string instead of a data set (collection).
Please teach me how to use input field to control dynamic finder and return a "data set' object. So the returning object can be display in table with gird, paging....
Thanks.
Code:
It returns a long string instead of a data set (collection).
Please teach me how to use input field to control dynamic finder and return a "data set' object. So the returning object can be display in table with gird, paging....
Thanks.
Code:
Code:
class ContractorController < ApplicationController
def show
term = params[:contractor_name]
@contractor = Contractor.all(:conditions => ["contractor_name LIKE ?", "#{term}" + "%"])
end
<% form_remote_tag(:update => "test_Ajx",
:controller => "Contractoradmin",
:url => {:action => :show},
:method => "get",
:option => "top") do %>
Contract Name:
<%= text_field_tag :contractor_name %>
<%= submit_tag "Set", :onclick=> "doloadData()" -%>
<ul id = test_Ajx>
<li>Original item...Pleae add more!</li>
</ul>
<% end %>