Say I wanted to run 'User.all.each{|u| u.destroy}' from a shell script called killallusers.sh. How can I call Rails console commands from the shell or from an executable script?
1 Answer
Either write it as a Rake task, or use Rails "runner".
Inside your shell script put the appropriate rake or runner command.
1 Comment
glenn jackman
@brojsimpson, if that answered your question, reward the answerer by accepting the answer: click the checkmark beside the answer.