I have some static partials that do not belong to any controller, and don''t actually have ruby code in them (which should be irrelevant anyway). I have to read the files in, and allow a user to click next/prev to navigate through them. I can read the directories fine, get access to the files, etc., but I''m having trouble with the application knowing about my custom folder in the "views" directory (I think). Here''s what I''m doing on page load (which isn''t working): <% render :partial => "#{CONTENT_BASE}/#{@thing.folder_title}/#{make_partial(@random_file)}" %> Here''s an explanation: # in environment.rb CONTENT_BASE = "#{RAILS_ROOT}/app/views/content" # @thing.folder_title => the_parent_folder # make_partial(_random.rhtml) => random So if I print out this line, without rendering the partial, I get the correct path: # looking at the path "./script/../config/../app/views/content/the_parent_folder/random" But I''m getting the error ActionView error "No rhtml, rxml, rjs or delegate template found" Is there something I''m missing? Can you not reference a static partial if it doesn''t belong to a controller? How can I get my application to understand this? Thanks! -- 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 -~----------~----~----~----~------~----~------~--~---
Bill Siggelkow
2007-Feb-07 14:57 UTC
Re: "No rhtml, rxml, rjs or delegate template found" -- help!
Rails assumes that the path specified for a partial is located under app/view ... not the full-path. Therefore you just need to change your CONTENT_BASE to be "content". Also make sure you use <%= %> and not <% %> -Bill On Feb 7, 9:46 am, rph <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> I have some static partials that do not belong to any controller, and > don''t actually have ruby code in them (which should be irrelevant > anyway). I have to read the files in, and allow a user to click > next/prev to navigate through them. I can read the directories fine, > get access to the files, etc., but I''m having trouble with the > application knowing about my custom folder in the "views" directory (I > think). > > Here''s what I''m doing on page load (which isn''t working): > > <% render :partial => > "#{CONTENT_BASE}...@thing.folder_title}/#{make_partial(@random_file)}" > %> > > Here''s an explanation: > > # in environment.rb > CONTENT_BASE = "#{RAILS_ROOT}/app/views/content" > > # @thing.folder_title > => the_parent_folder > > # make_partial(_random.rhtml) > => random > > So if I print out this line, without rendering the partial, I get the > correct path: > > # looking at the path > "./script/../config/../app/views/content/the_parent_folder/random" > > But I''m getting the error ActionView error "No rhtml, rxml, rjs or > delegate template found" > > Is there something I''m missing? Can you not reference a static partial > if it doesn''t belong to a controller? How can I get my application to > understand this? Thanks! > > -- > 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 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 -~----------~----~----~----~------~----~------~--~---
Bill Siggelkow wrote:> Rails assumes that the path specified for a partial is located under > app/view ... not the full-path. Therefore you just need to change your > CONTENT_BASE to be "content". Also make sure you use > <%= %> and not <% %> > > -BillThank you... that worked. -- 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 -~----------~----~----~----~------~----~------~--~---