I have been programming in RoR for about 2 months now, but the projects
that I have started I have aloways started in the middle, so I have
never built anything from the ground up. I’m now trying to start from
the beginning and am getting a strange error message when trying to load
the first page:
no route found to match “/music/index.rhtml” with {:method=>:get}
Now, there is a method for index but it just redirect_to another method
and page. This should be working but I;m wondering if I don’t have some
strange configuration issue somewhere? Thanks in advance,
map.connect ‘:controller/:action/:id’ and a couple others.
the order of the routes that you put there could be causing a mess (if
you are asking about configuration issues that has to do with routing,
it would be in this file; therefore, this may be the problem.) - make
sure the settings are in the correct order: the routes that appear on
the top are higher precedence than the ones at the bottom. (even if you
know this, it can be confusing, and this could be a problem of a route
‘overwriting’ a different one.)
aside from that, just at looking at the error
no route found to match “/music/index.rhtml” with {:method=>:get}
is a little odd; is the url you are directing to end with “…rhtml” ?
if you were just plain redirecting to :action => :music, it would error
out like
map.connect ‘:controller/:action/:id’ and a couple others.
the order of the routes that you put there could be causing a mess (if
you are asking about configuration issues that has to do with routing,
it would be in this file; therefore, this may be the problem.) - make
sure the settings are in the correct order: the routes that appear on
the top are higher precedence than the ones at the bottom. (even if you
know this, it can be confusing, and this could be a problem of a route
‘overwriting’ a different one.)
aside from that, just at looking at the error
no route found to match “/music/index.rhtml” with {:method=>:get}
is a little odd; is the url you are directing to end with “…rhtml” ?
if you were just plain redirecting to :action => :music, it would error
out like
no route found to match “/music/index”
anyway.
The redirect does end in .rhtml but in my controller I am saying
redirect_to :action => 'welcome"
I have tried it with just putting a simple “Hello World” for the index
page and that works. Its just when I try and redirect from the index
method to my welcome page do I get this error. Thanks,