Joshua Mckinney wrote:
> Just to be clear, this is an ajax request correct?  TRUE
> 
> I believe your create method is inside your comments controller, TRUE
> 
> You could try to use the render method to specify the location of the
> view like (i have not tried this with an ajax request):
> 
     render => '/stories/create'
gives errors

> 
>  or place the create.js.rjs in the comments views folder 

There is a copy in views/comments but look at the attached screenshot. 
The pig is created by the 'add a fox' link using
<%= link_to_remote("Add a fox",
      :url =>{ :action => :add }) %>.
 The relevant rjs file is views/stories/add.rjs nb it is in stories and 
has a .rjs extension. It evidently works. This suggests to me that the 
fault must be in the ajax request. Here it is

 <% remote_form_for :comment, :update =>'aremark', 
:url=>story_comments_path(@story) do |form| %>
       <div id="body"><%= form.text_field :body %></div>
       <p><%= submit_tag  'Comment' %></p>

Can you see anything wrong?

This is add.rjs

page.insert_html :bottom, 'aremark', :partial => 'user/pig'
page.visual_effect :highlight, 'aremark', :duration => 8
page.replace_html 'header', 'pig'


In peace Neil


Attachments:
http://www.ruby-forum.com/attachment/4904/Screenshot-2.png

-- 
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