Cool Rails Commands


Fun Things

If you ever want to connect to your own server or someone else's over your ethernet, use the following command in your terminal to start your server:

rails s -b 0.0.0.0 -p 3000

Wanting to run two different rails servers at once on the same machine? Simply change the ports the are running on to have them run simultaneously.

rails s -p 3000 
rails s -p 4000

If you need to add any images to your rails app with carrierwave or in general, here is how to do it for that column.

File.new(Rails.root.join("app","assets", "images", "my_image.png"))