Jatinder Singh
2008-Mar-24 20:36 UTC
[Facebooker-talk] render not able to locate template in publisher
Hi guys, I have a publisher called UserPublisher setup in models directory of my app. The reason I have it in a model is because its then possible for me to invoke publisher methods in after_callbacks of my other models, just the way we do it for ActionMailer. My problem is that when I try to update a users profile specifying location of the view template as a paramater to "profile" method, it gives an error "ActionView::TemplateFinder::InvalidViewPath (Unprocessed view path found: "/home/jatinder/rails_apps/app-name/app/views/." The call to profile method looks like this, profile render :partial => "/users/profile", :assigns => {:user => user_to_be_updated } Anybody has a clue where could I be wrong? Jatinder
Jatinder Singh
2008-Mar-25 02:46 UTC
[Facebooker-talk] render not able to locate template in publisher
I resolved this by replacing following line in method "initialize_template_class" of publisher.rb returning ActionView::Base.new([template_root,File.join(template_root,self.class.controller_path)], assigns, self) do |template| with path = ActionController::Base.view_paths rescue ActionController::Base.view_root returning ActionView::Base.new(path, assigns, self) do |template| Anyone who has faced a similar problem before? Thanks Jatinder On Mon, Mar 24, 2008 at 1:36 PM, Jatinder Singh <jatinder.saundh at gmail.com> wrote:> Hi guys, > > I have a publisher called UserPublisher setup in models directory of > my app. The reason I have it in a model is because its then possible > for me to invoke publisher methods in after_callbacks of my other > models, just the way we do it for ActionMailer. > > My problem is that when I try to update a users profile specifying > location of the view template as a paramater to "profile" method, it > gives an error "ActionView::TemplateFinder::InvalidViewPath > (Unprocessed view path found: > "/home/jatinder/rails_apps/app-name/app/views/." > > The call to profile method looks like this, > profile render :partial => "/users/profile", :assigns => {:user => > user_to_be_updated } > > > Anybody has a clue where could I be wrong? > > Jatinder >
David Clements
2008-Mar-25 18:03 UTC
[Facebooker-talk] render not able to locate template in publisher
I just added a section on profiles to the facebooker tutorial, it isn''t too through but it might help. http://apps.facebook.com/facebooker_tutorial/messaging/profile The only differences I see are that my publisher is in RAILS_ROOT/lib and I have the extenstions on the partial''s paths, ( I don''t remember why I did that ). I don''t understand that initialize_template_class method so I don''t have any insight there. But is there really a period after the last slash? "/home/jatinder/rails_apps/app-name/app/views/." that seems suspect. BTW: You don''t need to have your publisher in the models directory in order to use it in a model. Dave On Mon, Mar 24, 2008 at 8:46 PM, Jatinder Singh <jatinder.saundh at gmail.com> wrote:> I resolved this by replacing following line in method > "initialize_template_class" of publisher.rb > returning ActionView::Base.new([template_root,File.join(template_root, > self.class.controller_path)], > assigns, self) do |template| > > with > > path = ActionController::Base.view_paths rescue > ActionController::Base.view_root > returning ActionView::Base.new(path, assigns, self) do |template| > > Anyone who has faced a similar problem before? > > > > Thanks > Jatinder > > > On Mon, Mar 24, 2008 at 1:36 PM, Jatinder Singh > <jatinder.saundh at gmail.com> wrote: > > Hi guys, > > > > I have a publisher called UserPublisher setup in models directory of > > my app. The reason I have it in a model is because its then possible > > for me to invoke publisher methods in after_callbacks of my other > > models, just the way we do it for ActionMailer. > > > > My problem is that when I try to update a users profile specifying > > location of the view template as a paramater to "profile" method, it > > gives an error "ActionView::TemplateFinder::InvalidViewPath > > (Unprocessed view path found: > > "/home/jatinder/rails_apps/app-name/app/views/." > > > > The call to profile method looks like this, > > profile render :partial => "/users/profile", :assigns => {:user => > > user_to_be_updated } > > > > > > Anybody has a clue where could I be wrong? > > > > Jatinder > > > _______________________________________________ > Facebooker-talk mailing list > Facebooker-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/facebooker-talk >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/facebooker-talk/attachments/20080325/9c72f056/attachment.html