Run a php script in ruby on rails

后端 未结 4 927
长情又很酷
长情又很酷 2020-12-19 16:15

In one of my Rails application I need to execute a PHP file from the Controller of Ruby on Rails app. The PHP file meant for some database editing.

The php file loca

4条回答
  •  不知归路
    2020-12-19 17:00

    Try `php #{RAILS_ROOT}/public/php_script.php` or %x["php #{RAILS_ROOT}/public/php_script.php"]

    System command doesn't work in rails but some code like the above should be ok.

提交回复
热议问题