extension.rb

Path: lib/routing_filter/filters/extension.rb
Last Update: Wed Dec 21 14:15:47 +0200 2011

The Extension filter chops a file extension off from the end of the recognized path. When a path is generated the filter re-adds the extension to the path accordingly.

  incoming url: /de/products/page/1
  filtered url: /de/products
  params:       params[:locale] = 'de'

You can install the filter like this:

  # in config/routes.rb
  Rails.application.routes.draw do
    filter :locale
  end

To make your named_route helpers or url_for add the pagination segments you can use:

  products_path(:locale => 'de')
  url_for(:products, :locale => 'de'))

[Validate]