Christopher Bailey
2008-Mar-05 00:26 UTC
[Facebooker-talk] Template path issues for Publisher
I''m now dialed in on using Publisher, big thanks to Mike and folks for setting that up, it makes life much nicer! I have had to make two very small tweaks to the code to make it work for me. This is possibly due to us being on Rails 1.2.3 (my next chunk of work will be to get us to at least 1.2.6 and hopefully 2.x, but I need to finish the Facebook app first :) Anyway, I mentioned the first tweak in a previous email, but will cover both here for completeness, and any comments/info folks have: 1) In Publisher#inherited, it makes a call to send!, but send! is undefined in my environment. I simply changed this to call send (i.e. no exclamation point), and it all appears to work fine. 2) In Publisher#initialize_template_class, when it instantiates the ActionView::Base object, it passes in a template path that is an array holding both the base views directory, as well as the specific controller view subdirectory. In our environment, this yielded a second specific view directory name on the path when ActionView::Base#template_exists? went looking for the partial. For example, I''d see it looking for paths like: .../app/views/facebook_publisher/facebook_publisher/_profile.rhtml I don''t now if it''s different in Rails 2, and/or if the intent is that both those paths should be searched when looking for templates (and that array aspect simply didn''t work in Rails 1.2.3?) or what. But, the fix was to remove the specific subdirectory, and thus change that line of code to: returning ActionView::Base.new(template_root, assigns, self) do |template| I''ve marked up my code and will revisit this once I get our codebase moved to Rails 2, but wanted to put this out there in case had further info, or in case this might help someone else. -- Christopher Bailey Cobalt Edge LLC http://cobaltedge.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/facebooker-talk/attachments/20080304/01773f3a/attachment.html