Asp Forum
Home
|
Login
|
Register
|
Search
Forums
>
comp.lang.ruby
erb and rhtml templates?
Du De
7/15/2008 10:35:00 PM
I've got a website w/ lunarpages, and I've been using erb to do some
things w/ my pages. Everything has worked well so far.
My problem is, my main pages each call in header and footer templates,
but I can't figure out how to get the server to evaluate the templates
if they are .rhtml files w/ embedded ruby code.
I've tried:
----------------
<% require 'erb'
def import_erb path
ERB.new(File.read(path)).result()
# or ERB.new(File.read(path), nil, nil, '_x_').result()
end
%>
# and then
<%= import_erb('footer.rhtml') %>
----------------
But I get a '500 internal server error'. If I leave out the .result
call, there's no problem. I wonder if it's lunarpages or my fault.
--
Posted via
http://www.ruby-...
.
2 Answers
Phlip
7/18/2008 6:38:00 PM
0
Du De wrote:
> But I get a '500 internal server error'.
Figure out where your server sticks your error*log file (either error.log or
error_log) and tail it. You must start with the actual error message!
--
Phlip
Du De
7/21/2008 7:14:00 PM
0
Phlip wrote:
> Du De wrote:
>
>> But I get a '500 internal server error'.
>
> Figure out where your server sticks your error*log file (either
> error.log or
> error_log) and tail it. You must start with the actual error message!
Actually, that is from the error log. It is no more informative than
that.
--
Posted via
http://www.ruby-...
.
Servizio di avviso nuovi messaggi
Ricevi direttamente nella tua mail i nuovi messaggi per
erb and rhtml templates?
Inserendo la tua e-mail nella casella sotto, riceverai un avviso tramite posta elettronica ogni volta che il motore di ricerca troverà un nuovo messaggio per te
Il servizio è completamente GRATUITO!
x
Login to ForumsZone
Login with Google
Login with E-Mail & Password