Is it possible to apply a layout to rhtml files in the public folder?
These files are essentially static.
I am trying to avoid having to create blank actions/methods for each
html
files.
Is it possible to apply a layout to rhtml files in the public folder?
These files are essentially static.
I am trying to avoid having to create blank actions/methods for each
html
files.
render :file => “path/file”, :layout => true
should do that
it would expect an erb file, but should work with pure html, too
if not, then
render :inline => …
or
render :text =>
would do it, but you would have to load the file and hand it’s content
to the renderer
anyway, you would not have to create any actions or methods for that,
you could just put the content into a partial
Sorry about my inexperience - where do you suggest to put the line
render :file => “path/file”, :layout => true
When I try to add the line
<% render :file => “my_path/my_file.erb”, :layout => true %>
at the top of my page - called “index.rhtml”
I get a routing error:
no route found to match “/index.rhtml” with {:method=>:get}
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs