I started learning rails a few days ago and I’m reading head first rails (Dont judge, we all have to start somewhere). It seems to be using rails 2.3 whereas I’m using 3.0….
My question is syntactical.
Routing used to be done with
#map.connect 'ads/:id', :controller=>'ads', :action=>'show'
My new attempt at it is this
match "ads/id" => "ads" :action "show"
or
match "ads/id" => "ads" "show"
Both of which give me errors. For the first one, :action gives me unexpected kend and points to the ‘a’.
without it i get missing action.
Can anyone help me out with the correct syntax?
Here’s the format you want to use:
The official Rails Routing from the Outside In guide is a great resource to learn about routes.