Route code not recognized in browser


I wrote out a route code and got it to be acknowledged by the rake route command, but when I go to the browser it gives me the error message of routing error no route matches. What is going on and how do I fix it. Thank you.


Hi @Dempshi

It would be easier for us to help you solve the problem if you could provide some code and also tell us what tools are you using (frameworks, etc.)


I am using rails and this is the code for my route:
get ‘welcome/home’, to: ‘welcome#home’

Again this is recognized when I use rake route but not when I go to the browser and try to implement it.
Thank you


What URL are you entering to access this route? Do you have a welcomes controller? This route definition seems kind of strange.


I am using the url that comes within a new rails starter pack, so to speak. All I am trying to do is add a page to an existing url within that app. I have a controller, and the route comes up when I input the rake routes command, however when I try to execute with the url it will not recognize the route. I am in the midst of a course on ruby and rails and get everything the instructor does until this.



I have the same problem here…I working on a Udemy course, and is the same example!!

My controller:

class WelcomeController < ApplicattionController

def home



My route file:

Rails.application.routes.draw do

get 'welcome/home', to:  'welcome#home'


my home.html.erb file (views/welcome/home.html.erb)

Home page!

the URL that I´m using:


I had to change the route to;
get ‘welcome/home’ => ‘welcome#home’

I am not sure why but this server does not seem to recognize the to: in the route.


Using welcome/home for the URL is quite strange and it’s probably what’s giving you the error. Try this:

get 'welcome', to: 'welcome#home'


Hey guys! Thanks!!

I don´t know why, but I reset my computer and logged in again on C9 IDE and everything worked without any change on code!