[Rails] render file doesn't do anything
Hi,
the following piece code has been troubling me for a couple of days
now:
<% render :file => "../../public/images/projects/" + @project + "/
project.html" %>
it is in the index.html.erb file of a controller. I know that is not
really the intended use of the render function but for project
specific reasons i would like to do it like that. the integrated dev
webserver returns the following message:
Rendered public/images/projects/Jonas/_project.html (0.4ms)
so i assume the render was sucessfull but the problem is the html that
was supposed to be rendered is not in the resulting html file. it is
as if the render statement wasn't there.
just to be sure I tried another way as well. because render file =>
expects a file with an absolute path i did the following
<% file = File.open("public/images/projects/" + @project + "/
project.html") %>
<% render :inline => File.expand_path(file.path) %>
again the server reports sucess but there is nothing...at least not
what is supposed to be there.
So i have no idea what else to do. i could not find any answer in this
mailinglist or via stackoverflow (http://stackoverflow.com/questions/
5572098/rails-render-doesnt-do-anything)
i hope you guys will have a suggestion...thanks allready
jan
--
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@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home