Skip to content

Commit 461ec6f

Browse files
author
Mariusz Michalak
committed
Routes fix for new version of Rails (4.x.x)
1 parent a91792e commit 461ec6f

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

rails/routes.rb

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,21 @@
11
if defined?(Rails::Application)
2+
major = Rails.version.split(".").first.to_i
3+
24
# Rails3 routes
35
Rails.application.routes.draw do
46
match "/#{Jammit.package_path}/:package.:extension",
57
:to => 'jammit#package', :as => :jammit, :constraints => {
68
# A hack to allow extension to include "."
79
:extension => /.+/
810
}
9-
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
1021
end

0 commit comments

Comments
 (0)