Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Will generate different routes for models and resources.

  • Loading branch information...
commit 7abbcba195c1ca3005b5342764f9da8cbc73e9a9 1 parent 866c445
@fesplugas fesplugas authored
Showing with 7 additions and 2 deletions.
  1. +7 −2 config/routes.rb
View
9 config/routes.rb
@@ -21,8 +21,13 @@
end
end
- controllers = Typus.models.map(&:to_resource) + Typus.resources.map(&:underscore)
- controllers.each { |c| match "#{c}(/:action(/:id))(.:format)", :controller => c }
+ Typus.models.map(&:to_resource).each do |_resource|
+ match "#{_resource}(/:action(/:id))(.:format)", :controller => _resource
+ end
+
+ Typus.resources.map(&:underscore).each do |_resource|
+ match "#{_resource}(/:action(/:id))(.:format)", :controller => _resource
+ end
end
Please sign in to comment.
Something went wrong with that request. Please try again.