DEV Community

Cover image for Preview locally running Rails app in mobile
Nikhil Devarasetty
Nikhil Devarasetty

Posted on

Preview locally running Rails app in mobile

I used to make things that were comfortable for the screen resolution I was using as a novice, but as time went on and I started producing substantial stuff, I realised I needed to construct mobile-first features.

Of course, Chrome comes with a responsive view and a mobile view, but why do you need to preview in mobile? 🤔 🤔 🤔

Let say when trying to input something in text fields in mobile, keyboard will pop up, and sticky footer might cover up text fields, which we usually not observe in laptops.

Cases like above require to preview app in mobile before pushing into production.

So to preview in the Rails app in mobile follow the steps:

  1. Make sure your laptop and phone are connected
  2. Start sever in local with rails s -p 3000 -b <IPv4 address of network>
  3. To get IPv4 address of the network connected
    • Go to settings > netwrok
    • Run ipconfig in command line

Top comments (0)