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!