I have a simple ajax request that should return a partial, but for some reason I am continually told that it is not there. I have modified the partial location to other partials that do work fine elsewhere and it still tells me that it can''t find those files. Here is the code: =========class Admin::ContentPhotosController < ApplicationController ... def new respond_to do |format| format.js { render :partial => "admin/content_photos/form" } end end ... end Here is some console output showing that the file exists =================================$ ls app/views/admin/content_photos/ _form.html.haml index.html.haml new.html.haml Here is the error message if when I access http://localhost:3000/admin/content_photos/new.js ==========================================================Couldn''t find template file for admin/content_photos/_form Help is appreciated. -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
iso .. wrote:> > Here is the code: > =========> class Admin::ContentPhotosController < ApplicationController > ... > def new > respond_to do |format| > format.js { render :partial => "admin/content_photos/form" } > end > end > ... > end >format.js { render :partial => "form" } hth ilan -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Ilan Berci wrote:> iso .. wrote: >> >> Here is the code: >> =========>> class Admin::ContentPhotosController < ApplicationController >> ... >> def new >> respond_to do |format| >> format.js { render :partial => "admin/content_photos/form" } >> end >> end >> ... >> end >> > > format.js { render :partial => "form" } > > > hth > > ilanUnfortunately, that doesn''t seem to work either. I get the same error message: ------- ActionView::ActionViewError (Couldn''t find template file for admin/content_photos/_form in ["/Users/chris/Documents/Projects/Rails/cms/app/views"]): ------ I wasn''t aware that you could render the partials using that path, so thanks for that :) -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Hi -- On Tue, 18 Mar 2008, iso .. wrote:> > Ilan Berci wrote: >> iso .. wrote: >>> >>> Here is the code: >>> =========>>> class Admin::ContentPhotosController < ApplicationController >>> ... >>> def new >>> respond_to do |format| >>> format.js { render :partial => "admin/content_photos/form" } >>> end >>> end >>> ... >>> end >>> >> >> format.js { render :partial => "form" } >> >> >> hth >> >> ilan > > Unfortunately, that doesn''t seem to work either. I get the same error > message:Try calling your partial _form.js.haml. David -- Upcoming Rails training from David A. Black and Ruby Power and Light: ADVANCING WITH RAILS, April 14-17 2008, New York City CORE RAILS, June 24-27 2008, London (Skills Matter) See http://www.rubypal.com for details. Berlin dates coming soon! --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
David A. Black wrote:> Hi -- > > On Tue, 18 Mar 2008, iso .. wrote: > >>>> format.js { render :partial => "admin/content_photos/form" } >>> >>> ilan >> >> Unfortunately, that doesn''t seem to work either. I get the same error >> message: > > Try calling your partial _form.js.haml. > > > DavidI didn''t want to call it _form.js.haml since it is rendered on a normal http request, but renaming it to _form.haml did the trick, which makes perfect sense. Thanks David. -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---