Czesc,
Mam taki problem.
Korzystam z observer_filed do przeszukiwania listy z automatycznym odświeżaniem jej zawartości. Wyglada to mniej wiecej tak:
index.html.erb:
<%= text_field_tag “search” %>
<%= observe_field ‘search’, :url => {:action => “search_list”},
:frequency => 0.5,
:update => ‘transactions_list’,
:with => “‘text=’ + escape(value)”
%>
transaction_controller.rb:
def search_list
if params[:text]
@transactions = Transaction.find(:all, :order => “created_at DESC”, :conditions => [ ‘LOWER(name) LIKE ?’, ‘%’ + params[:text].downcase + ‘%’ ]).reverse
render :partial => ‘transactions_list’
else
@transactions = Transaction.find(:all, :order => “created_at DESC”).reverse
render :partial => ‘transactions_list’
end
end
problem polega na tym ze dispatcher za Chiny Ludowe nie chce odnalezc podanej akcji “search_list” i ciagle sie upiera dziad jeden przy akcji “show” - niewiadomo dlaczego.
tak to wyglada w logach:
Processing TransactionsController#show (for 127.0.0.1 at 2008-12-10 14:58:42) [GET]
Parameters: {“text”=>“greg”, “authenticity_token”=>“484c0acdba12c67bfd3e842206db6fa122163fca”, “id”=>“search_list”}
Rendering transactions/show
Completed in 9ms (View: 4, DB: 0) | 200 OK [http://localhost/transactions/search_list?text=greg&authenticity_token=484c0acdba12c67bfd3e842206db6fa122163fca]
no wystarczy nawet spojrzeć na te logi - przeciez to bez sensu jest!
skad sie wzielo “Processing TransactionsController#show”?
skad sie wzielo “id”=>“search_list”
niech ktos pomoze