erb and rhtml templates?

D

Du De

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') %>
 
P

Phlip

Du said:
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!
 
D

Du De

Phlip said:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,968
Messages
2,570,154
Members
46,702
Latest member
LukasConde

Latest Threads

Top