Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Changes over the filters comments. closes #24

  • Loading branch information...
commit e89d2f1bbfea7eee2bd2d99d0cab4547800fc8cc 1 parent c94b8b5
@robertodecurnex robertodecurnex authored
View
16 lib/routing_filter/filters/extension.rb
@@ -2,22 +2,16 @@
# 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'
+# incoming url: /products.xml
+# filtered url: /products
+# generated url: /products.xml
#
# You can install the filter like this:
#
# # in config/routes.rb
# Rails.application.routes.draw do
-# filter :locale
+# filter :extension
# 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'))
module RoutingFilter
class Extension < Filter
@@ -73,4 +67,4 @@ def mime_extension?(url)
url =~ /\.#{Mime::EXTENSION_LOOKUP.keys.join('|')}(\?|$)/
end
end
-end
+end
View
8 lib/routing_filter/filters/locale.rb
@@ -1,10 +1,10 @@
# The Locale filter extracts segments matching /:locale from the beginning of
-# the recognized path and exposes the page parameter as params[:page]. When a
+# the recognized path and exposes the page parameter as params[:locale]. When a
# path is generated the filter adds the segments to the path accordingly if
# the page parameter is passed to the url helper.
#
-# incoming url: /de/products/page/1
-# filtered url: /de/products
+# incoming url: /de/products
+# filtered url: /products
# params: params[:locale] = 'de'
#
# You can install the filter like this:
@@ -14,7 +14,7 @@
# filter :locale
# end
#
-# To make your named_route helpers or url_for add the pagination segments you
+# To make your named_route helpers or url_for add the locale segments you
# can use:
#
# products_path(:locale => 'de')
View
10 lib/routing_filter/filters/uuid.rb
@@ -3,8 +3,8 @@
# the filter adds the segments to the path accordingly if the page parameter is
# passed to the url helper.
#
-# incoming url: /d00fbbd1-82b6-4c1a-a57d-098d529d6854/product/1
-# filtered url: /product/1
+# incoming url: /d00fbbd1-82b6-4c1a-a57d-098d529d6854/products
+# filtered url: /products
# params: params[:uuid] = 'd00fbbd1-82b6-4c1a-a57d-098d529d6854'
#
# You can install the filter like this:
@@ -16,8 +16,8 @@
#
# To make your named_route helpers or url_for add the uuid segment you can use:
#
-# product_path(:uuid => uuid)
-# url_for(product, :uuid => uuid)
+# products_path(:uuid => uuid)
+# url_for(:products, :uuid => uuid)
module RoutingFilter
class Uuid < Filter
@@ -37,4 +37,4 @@ def around_generate(params, &block)
end
end
end
-end
+end
Please sign in to comment.
Something went wrong with that request. Please try again.