I was trying to write my first program after installation, but I got an error like below:
Routing Error
No route matches [GET] "/firstapp"
I've tried to change my config/routes.rb
file but nothing changed. This is my config/routes.rb
Firstapp::Application.routes.draw do
resources :apptables
# The priority is based upon order of creation:
# first created -> highest priority.
# con开发者_如何学Gotinues with default `config/routes.rb` explanations...
end
How can I configure the config/routes.rb
to make it run properly?
Just saying resources :apptables
sets up the standard seven routes:
GET /apptables
GET /apptables/new
POST /apptables
GET /apptables/:id
GET /apptables/:id/edit
PUT /apptables/:id
DELETE /apptables/:id
There is no /firstapp
in that list so that route won't work. If you want a GET on /firstapp
to work then you can set up that route manually:
match '/firstapp' => 'firstapp#some_method', :via => :get
That would route GET /firstapp
to FirstappController#some_method
.
精彩评论