lemon
lemon

Reputation: 9205

Rails Routes Starting Slash

Could someone please tell me the significance of starting slashes on routes?

get "search" => "hello#world"
vs
get "/search" => "hello#world"

both works but what's the difference?

Upvotes: 3

Views: 144

Answers (1)

d11wtq
d11wtq

Reputation: 35298

They are the same. Ruby on Rails is just being forgiving by allowing both formats. You may use them interchangeably.

Upvotes: 4

Related Questions