Viewport meta tag removed from application layout during `rails new`

The last few times I’ve generated a new rails app I’ve had to add the viewport meta tag so that the page sized correctly on mobile browsers <meta name="viewport" content="width=device-width,initial-scale=1">.

I figured this was an easy fix so went looking, but it’s already in the main template

Somewhere along the way with rails new this is getting stripped out, I spent some time looking but couldn’t figure out where that might be. I just tried rails new with rails version 6.0.3 and the same thing happened, meta tag missing.

2 Likes

Could you report this as an issue and link it in Interactive “rails new”? There’s a lot of energy there around improving the Rails scaffolding process, so maybe we can knock this issue out that way.

It looks like the change just hasn’t been released yet and will be in the rails 6.1 release Viewport meta tag removed from application layout during `rails new` · Issue #39270 · rails/rails · GitHub

2 Likes