Topic: How will i get the response?????????

my problem is am getting the response from the partial when am viewing through firebug.But its showing only when the page refreshes.

I am pasting here the code for each:

SUBJECTS CONTROLLER
class SubjectsController < ApplicationController
    layout 'standard'
    def index
        @subject = Subject.new
        @subjects = Subject.all
       
        respond_to do |format|
          format.html # index.html.erb
          format.xml  { render :xml => @subjects }
        end
    end
    def show
        @subject = Subject.find(params[:id])

    end
    def create
        @subject = Subject.new(params[:subject])
        if @subject.save
             render :partial => "subject", :object => @subject

        end

    end

end

INDEX FILE IN THE SUBJECTS VIEW
<h1>Listing Subjects</h1>
<ul id="subject_list">
<% @subjects.each do |c| %>
<li><%= link_to c.name, :action => 'show', :id => c.id %>
<%= "(#{c.books.count})" -%></li>
<% end %>
</ul>
<p id="add_link"><%= link_to_function("Add a Subject",
"Element.remove('add_link'); Element.show('add_subject')")%></p>

<div id="add_subject" style="display:none;">
<%= form_for (@subject,:remote => true,:update => "subject_list", :position => :bottom,
    :html => {:id => 'subject_form'}) do |f|%>
<div class="field">
    <%= f.label :name %><br />
    <%= f.text_field :name %>
  </div>
  <div class="actions">
    <%= f.submit %>
  </div>
<% end %>

</div>

PARTIAL SUBJECT
<li id="subject_<%= subject.id %>">
<%= link_to subject.name, :action => 'show', :id => subject.id %>
<%= "(#{subject.books.count})" -%>
</li>


SOME ONE PLEASE HELP ME

Re: How will i get the response?????????

not sure but I am surprised by your

format.xml  { render :xml => @subjects }

and i would have used

format.js { render :xml => @subjects }

because this is a javascript call

Re: How will i get the response?????????

Some one plz help me