Skip to content

Instantly share code, notes, and snippets.

@rbarazi
Created March 2, 2010 20:54
Show Gist options
  • Save rbarazi/319933 to your computer and use it in GitHub Desktop.
Save rbarazi/319933 to your computer and use it in GitHub Desktop.
[Beginning Rails 3] Listing 2-4. The config/routes.rb file
Hello::Application.routes.draw do |map|
match ':controller(/:action(/:id(.:format)))'
end
@ansaanch
Copy link

Hello rbarazi,
I am learning rails and I am using "beginning rails 4 3rd edition". I am sill on the basic "hello world" and at first the code in the book for the routes.rb didn't work. rails server wasn't able to launch. I read the message and I figured out that the error was in the routes.rd file so instead of your code, I inserted the code below:
Rails.application.routes.draw do
get':controller(/:action(/:id(.:format)))'
end
I am on mac I would like know why the ones you provide didnt work.
Thanks

@fongfan999
Copy link

fongfan999 commented Jul 14, 2016

Hi @ansaanch, If you're using Rails 4, you can do the following:

get 'salutation/hello'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment