开发者

Rails 3 - Made a new controller action and view but cant route it

开发者 https://www.devze.com 2023-02-03 21:32 出处:网络
I\'m using Rails 3 I have a controller called subscriber_controller.rb I just added an action called \"def houston\" and added this to my routes file

I'm using Rails 3

I have a controller called subscriber_controller.rb

I just added an action called "def houston" and added this to my routes file

 match '/houston' => 'subscriber#houston'
 get "subscriber/houston"

but whenever I try to go to "http://localhost:3000/houston" which was the goal i get the error

Routing Error No route matches "/houston"

What else do I need to add to the rout开发者_运维问答es file to find the correct action in the controller and have the url work as http://localhost:3000/houston ?


What does "rake routes" give you?

I tried the same thing and it worked.

Check that you saved your routes file.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号