Je suis coincé; J'ai fait une recherche et je ne trouve pas de pointeur sur la façon de faire fonctionner ce projet. J'ai une forme sur mon index.html.erb comme:Ruby On Rails 3 soumettre formulaire AJAX mise à jour résultats div
Maintenant, j'ai<html> <head>
<title>Ajax List Demo</title> <h1>Listing posts</h1>
<%= javascript_include_tag "prototype" %> </head> <body>
<h3>Add to list using Ajax</h3>
<% form_tag ( :remote=>true, :update => 'my_list', :action => :list , :method=>:post, :format =>:xml) do %>
Enter the url:
<%= text_field_tag 'url' ,'', :size => 80 %>
<%= submit_tag "Find" %>
<% end %>
<div id="my_list"><%= render :partial => 'profiles/list' %></div> </body> </html>
un div avec ce my_list appelé. Lorsque je soumets le formulaire, je veux que mon _list.html.erb partielle (répertoire des profils à l'intérieur, essayé home dir aussi) pour mettre à jour avec les résultats de la liste.
Mon contrôleur maison a cette méthode:
def list
puts "here!!!!"
reader = Reader.new
@profiles = reader.processURL(params[:url])
render :partial=>'profiles/list', :locals => { :profiles => @profiles}
end
je finis par obtenir cette erreur:
ActionView::MissingTemplate (Missing partial profiles/list with {:locale=>[:en, :en], :handlers=>[:rjs, :builder, :rhtml, :rxml, :
erb], :formats=>[:xml]} in view paths "C:/Users/....tree/app/views"):
app/controllers/home_controller.rb:22:in `list'
Rendered C:/Ruby187/lib/ruby/gems/1.8/gems/actionpack-3.0.0/lib/action_dispatch/middleware/templates/rescues/missing_template.erb
within rescues/layout (1.0ms)
Quelqu'un pourrait me aider ou me envoyer dans la bonne direction pour comprendre comment mettre à jour un div rendu via Rails sur le formulaire? Merci encore.