I'd like to run a rake task in my controller. Is there any way to do this?
Ruby-on-rails – Run rake task in controller
rakerubyruby-on-rails
Related Topic
- Ruby-on-rails – How to use “gets” on a rake task
- Ruby – How to run Rake tasks from within Rake tasks
- Ruby – How to pass command line arguments to a rake task
- Ruby-on-rails – Do rails rake tasks provide access to ActiveRecord models
- Ruby – How to return early from a rake task
- Ruby-on-rails – Rails how to run rake task
- Ruby-on-rails – Difference between rake db:migrate db:reset and db:schema:load
Best Answer
I agree with ddfreynee, but in case you know what you need code can look like:
You can require 'rake' and .load_tasks in an initializer instead.