We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a91792e commit 461ec6fCopy full SHA for 461ec6f
rails/routes.rb
@@ -1,10 +1,21 @@
1
if defined?(Rails::Application)
2
+ major = Rails.version.split(".").first.to_i
3
+
4
# Rails3 routes
5
Rails.application.routes.draw do
6
match "/#{Jammit.package_path}/:package.:extension",
7
:to => 'jammit#package', :as => :jammit, :constraints => {
8
# A hack to allow extension to include "."
9
:extension => /.+/
10
}
- end
11
+ end if major == 3
12
13
+ # Rails4 routes
14
+ Rails.application.routes.draw do
15
+ get "/#{Jammit.package_path}/:package.:extension",
16
+ :to => 'jammit#package', :as => :jammit, :constraints => {
17
+ # A hack to allow extension to include "."
18
+ :extension => /.+/
19
+ }
20
+ end if major == 4
21
end
0 commit comments