PHP includes in Rails

This is how to include a PHP script inside a Rails template. Got this useful tidbit from Rails Forum. The equivalent of:

<?php include("path/to/menu.php"); ?>

is

<%=`php path/to/menu.php`%>
  • Those are back quotes, otherwise known as a capital tilde.
  • You’ll obviously need PHP installed on your server for this to work.

Leave a Reply

Adventures in development - Web standards and Firefox extensions