Just to be clear, this is an ajax request correct?
I believe your create method is inside your comments controller, if
this is true then by default rails will look for views associated to
the methods in the comments controller in comments view folder (/
views/comments/....some views....).
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):
def create
@story = Story.find(params[:story_id])
@story.comments.create params[:comment]
request.format = :js
render => '/stories/create'
end
or place the create.js.rjs in the comments views folder (not sure
this work given the non-standard url being generated)
or create a custom route.
On Aug 3, 11:58 am, Neil Bye <[email protected]> wrote:
> Joshua Mckinney wrote:
> > Have you tried naming the file create.js.rjs?
>
> Good idea but no difference.
>
> The latest configuration of the create function is:
>
> def create
> @story = Story.find(params[:story_id])
> @story.comments.create params[:comment]
> request.format = :js
> end
>
> Gives a page with the addresshttp://localhost:3000/stories/2/comments
> it should behttp://localhost:3000/stories/2/and it says this.
>
> Template is missing
>
> Missing template comments/create.erb in view path app/views
>
> Even if I make create.html.erb or as it asks create.erb it makes no
> difference. Does that shed any light on the problem?
>
> In peace Neil
> --
> Posted viahttp://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.