Help... Ajax scaffold problems


#1

Hi all,
Any help is appreciated. I used the ajax scaffold generator to make 3
scaffoldings. Then I put them together as components in a combined
layout
and created a master controller, which happens to be named "dataentry’.
That works fine.

Within each of the components, I was able to set up links that paginate
and
update the div (for the component) with correctly paginated results. So
the
links are able to call into my list action, run the code there, then
update
the appropriate div with the results. However, what I can’t seem to do
is
get the div to update or change without the request coming from a
link–when
the code which should cause the update is coming from the controller.

I’m trying to have requests go to the master controller, and cause the
components to update.

Data entry page:
<%=observe_field :search_text,:frequency =>1,:with => “‘search_text=’ +
escape(value)”,:update=>:results,:url=>{:action =>:search }%>

<%= render_component :controller => ‘mails’, :action => ‘list’ %>
<%= render_component :controller => ‘locations’, :action => ‘list’ %>
<%= render_component :controller => ‘listings’, :action => ‘list’ %>

class DataEntryController < ApplicationController
def search
# search action calls component controllers
redirect_to :controller=>‘emails’, :action => ‘list’
end
end

class MailsController < ApplicationController
def list

     # I have confirmed the redirect works  - it looks like the code 

in
here runs
# but no screen update happens for the component.
# I want the code in here to update the div for mails, but
# I don’t know what code that should be to make the update
happen.
# The .rhtml file is named list. The search runs but
# how do I tell it my results go in the div ??? No code that
I
have tried in here
# seems to affect the component that displays the mails

 render :layout=>false

end
end

Any help is appreciated. Thanks,

Eric


#2

Eric B. wrote:

<%= render_component :controller => ‘mails’, :action => ‘list’ %>


Note: as submitted originally, the original said “emails” instead of
“mails”. That was not the problem… just a typo from a minute ago
when I
considered renaming things. Problem still exists… arg…

Eric