Printing a welcome message (message of the day) in Rails console
To print a message when a Rails console is opened via rails console
simply add
console do
puts 'Message of the day'
end
inside a config block of an initializer. It can be either config/application.rb
or per environment (config/environments/development.rb
)
You can run any arbitrary code in there as well!
Written by msz
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Rails ruby console
Authors
Related Tags
#rails ruby console
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#