user6465508
user6465508

Reputation: 57

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>

Upvotes: 0

Views: 108

Answers (1)

nikolayp
nikolayp

Reputation: 17919

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

Upvotes: 1

Related Questions