user6465508 user6465508 - 5 months ago 10
Ruby Question

Displaying a specific view in browser. Mistake in routes.rb file

Im trying to display a simple starting view in my browser by doing

http://localhost:3000/project/claim
but it keeps giving:

No route matches [GET] "/project/claim"


routes.rb
file:

Rails.application.routes.draw do
........
get 'project/claim' => 'claim#index'


controller/claim_controller
file:

class ClaimController < ApplicationController
def index
@message = "Hello, World!"
end
end


/views/claim/claim.html.erb
file:

<h1>A greeting for you! </h1>

<p> <%= @message %> </p>

Answer

rename: /views/claim/claim.html.erb on /views/claim/index.html.erb