I must be missing something, because I don''t get a clean way how to do this. I have a page which when you change the contents of a select, changes the contents of a div by calling an action. How do I have the contents of the div be the results of calling the action on the initial page load? I understand if I wanted to render just the template I could use partials, but I also need to have the action function called. NOTE: the main action should not depend on whether the updatable piece is included on the page. ie, controller: def main ...stuff... # should not care if page has a change_piece on it, so should not need to do change_piece stuff end def change_piece ...stuff that must happen... when called by ajax: render :update do |page| page.replace_html :bob, :partial => "piece" end when called as part of initial page load: render :partial => "piece" end view (main): <html> ...stuff... <div id="bob"> <%= render :action "change_piece" %></bob> ... </html> I tried using render_component, with a respond_to block in the action, but it just renders the first thing in the respond_to block. IE, if I have format.html first it renders that first. If I have format.js first, it renders that. (the respond_to block works correctly otherwise) Thanks, Michael Johnston --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---