View a Ruby on Rails Project in the Web-Browser Tab

How to bypass "Error: Refused to display 'https://example.com' in a frame because it set 'X-Frame-Options' to 'sameorigin'.

Ruby on Rails websites by default cannot be displayed in an IFrame. Since the Web-Browser tab displays the page in an IFrame, it will show an error when trying to visit a Rails website. You can get around this error by opening App/config/application.rb and adding the following config inside the class:

config.action_dispatch.default_headers = {
'X-Frame-Options' => 'ALLOWALL'
}

Then restart the Rails server and it should now be able to be displayed in the Web-Browser tab!