vkuz91

Joined

50 Experience
0 Lessons Completed
0 Questions Solved

Activity

I'm new to rails and trying to display a very simple app from codecademy which results in this error on my browser:

PagesController#welcome is missing a template for request formats: text/html

NOTE! Unless told otherwise, Rails expects an action to render a template with the same name, contained in a folder named after its controller. If this controller is an API responding with 204 (No Content), which does not require a template, then this error will occur when trying to access it via browser, since we expect an HTML template to be rendered for such requests. If that’s the case, carry on.

Here are the files:

pages_controller.rb

class PagesController < ApplicationController
def welcome
end
end

routes.rb

Rails.application.routes.draw do
root ‘pages#welcome’
end

I'm running 'rails server' and getting the above error in my browser. As far as I can tell the files are in the right place (app/view/pages/welcome.html.erb) and of the right type. Rails v 6.0.1.