Skip to content

Instantly share code, notes, and snippets.

@rbarazi
Created March 2, 2010 20:54
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • 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
@carlosfarah
Copy link

Me parece que método de criar uma rota não funciona mais na ultima versão do rails, será que você poderia atualizar o método?

@caarlos0
Copy link

Isso não funciona mais no rails 4. Dá uma olhada nesse link: http://stackoverflow.com/a/19722929/405013

@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