>         format.xml_http_request :get, "show",:id => @sample
> May be i am not using correctly the xml_http_request function.
You are correct. I don't know what xml_http_request is actually supposed
to do, but this should read something more like:

respond_to do |format|
      format.html { redirect_to(person_list_url) }
      format.js
      format.xml  { render :xml => @person.to_xml(:include => @company) 
}
    end

format.xml_http_request { ... } would be looking for a template
something like: show.xml_http_request.erb

Of course in reality, it just breaks.

> respond_to do |format|
>       if @sample.update_attributes(params[:sample])
>         flash[:notice] = 'Sample was successfully updated.'
>         format.html {redirect_to(@sample)}
>         format.xml_http_request :get, "show",:id => @sample
>       else
>         render :action => "edit"
> 
>       end
This also feels wrong to me. Maybe something more like:

if @sample.update_attributes(params[:sample])
  flash[:notice] = 'Sample was successfully updated.'
  respond_to do |format|
    format.html {redirect_to(@sample)}
    format.js
  end
else
  render :action => "edit"
end

-- 
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to