rizwanreza

rizwanreza

15p

11 comments posted · 0 followers · following 0

16 years ago @ Union Station - The Lowdown on Routes ... · 0 replies · +1 points

After setting up your redirect rules either in a middleware or in Apache, you can use scope as shown above and write all routes inside the block.

16 years ago @ Union Station - The Lowdown on Routes ... · 0 replies · +1 points

You're right, my bad! :)

I meant this:

redirect("http://github.com/rails.atom") do
# routes here
end

This is not supported, last I checked. Thanks!

16 years ago @ Union Station - The Lowdown on Routes ... · 0 replies · +1 points

My point was in regards to the pervasive blocks that the new DSL promotes.

Can you point out the typos? Thanks!

16 years ago @ Union Station - The Lowdown on Routes ... · 0 replies · +1 points

You are right but it still depends on the scenario.

16 years ago @ Union Station - The Lowdown on Routes ... · 0 replies · +1 points

Well, that can be done easily with new Routes:

match /products/show(/:type)' => 'products#show' # Available as params[:type]
match /assets/show(/:type)' => 'products#show'

If you'd rather not allow the user to mention the type in the URL:

match /products/show' => 'products#show', :type => 'simple' # Available as params[:type]
match /assets/show' => 'products#show', :type => 'complex'

16 years ago @ Union Station - The Lowdown on Routes ... · 0 replies · +1 points

From the looks of it, it will still require a plugin to support such functionality.

16 years ago @ Union Station - The Lowdown on Routes ... · 0 replies · +1 points

I agree, we'll see what we can do about that.

16 years ago @ Union Station - The Lowdown on Routes ... · 0 replies · +2 points

See this: http://github.com/rails/rails/commit/fef7a77386b0...

I will work through an example and add it to the article. Thanks.

16 years ago @ Union Station - The Lowdown on Routes ... · 0 replies · +1 points

The subdomains method was added recently in this commit: http://github.com/rails/rails/commit/fef7a77386b0...

16 years ago @ Union Station - The Lowdown on Routes ... · 0 replies · +1 points

No, the router doesn't surround Regular Expressions with implicit anchors right now.