Today I Learned

hashrocket A Hashrocket project

Rails 8 Generate One Off Scripts

Rails 8 added a new generator command for creating 1 script files. The docs encourage the use of this folder for one off tasks, data migrations, etc. Previously, you could have used rake tasks to accomplish a similar thing.

Running this generator command will create the script dir if one does not already exist.

❯ rails g script migration_script
      create  script/migration_script.rb
See More #rails TILs
Looking for help? Hashrocket has been an industry leader in Ruby on Rails since 2008. Rails is a core skill for each developer at Hashrocket, and we'd love to take a look at your project. Contact us and find out how we can help you.