Ive been learning PHP and tried to get into RoR and the two are always compared.My question is, is there a PHP include equivalent for Ruby on Rails. To me the ability to include PHP files is it's most valuable feature.
PHP is a programming language while Ruby on Rails is a framework therefore you're comparing two completely different things.
Assuming that you use include in PHP to build a page from many nested templates/scripts then partials would be the way to go in Rails, e.g.:
<%= render :partial => 'sidebar' %>
Ruby itself has also require which behaves similar to include or require in PHP but it doesn't work for views in Rails.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With