
router pluralization mess on rails3 when putting dm-core in gemfile
Reported by makevoid | February 14th, 2010 @ 04:53 PM
Hello,
there's something strange going on with rails3 and dm-core initialization procedure that pluralizes and messes rails3 routes (maybe caused by extlib?)
Anyway.. this is how you can reproduce the issue:
- Get rails3 beta: http://weblog.rubyonrails.org/2010/2/5/rails-3-0-beta-release
- generate an app (w/o activerecord of course!)
rails myapp -O
- edit app config/routes.rb and add something like
resources :posts
- now run from the application path
rake routes
it will print out this:
GET /posts(.:format) {:controller=>"posts", :action=>"index"}
posts POST /posts(.:format) {:controller=>"posts", :action=>"create"}
new_post GET /posts/new(.:format) {:controller=>"posts", :action=>"new"}
GET /posts/:id(.:format) {:controller=>"posts", :action=>"show"}
PUT /posts/:id(.:format) {:controller=>"posts", :action=>"update"}
post DELETE /posts/:id(.:format) {:controller=>"posts", :action=>"destroy"}
edit_post GET /posts/:id/edit(.:format) {:controller=>"posts", :action=>"edit"}
and it's ok!
now! add into your app Gemfile
gem "dm-core"
then the output of rake routes will become:
GET /postses(.:format) {:controller=>"postses", :action=>"index"}
postses POST /postses(.:format) {:controller=>"postses", :action=>"create"}
new_post GET /postses/new(.:format) {:controller=>"postses", :action=>"new"}
GET /postses/:id(.:format) {:controller=>"postses", :action=>"show"}
PUT /postses/:id(.:format) {:controller=>"postses", :action=>"update"}
post DELETE /postses/:id(.:format) {:controller=>"postses", :action=>"destroy"}
edit_post GET /postses/:id/edit(.:format) {:controller=>"postses", :action=>"edit"}
crazy huh? can someone else confirm it? thank you!
ruby: 1.9.1p376 (2009-12-07 revision 26041)
[i386-darwin10.2.0]
dm-core (0.10.2)
Comments and changes to this ticket
-
Dan Kubb (dkubb) February 14th, 2010 @ 09:16 PM
- State changed from new to unconfirmed
- Assigned user set to Martin Gamsjaeger (snusnu)
-
Martin Gamsjaeger (snusnu) February 14th, 2010 @ 09:34 PM
- State changed from unconfirmed to not-applicable
DataMapper and rails3 will not work together seamlessly out of the box. Have a look at the install instructions at
http://github.com/dkubb/rails3_datamapper
to get a rails3 app with dm up and running within minutes. The rails3_datamapper railtie takes specific measures to avoid the problem you're seeing. In particular, it relies on forks of dm-core and dm-more that make dm compatible with activesupport instead of extlib, and it injects a module into DataMapper::Resource that makes it compatible with the router. I should note that this module currently doesn't handle composite primary keys properly, but it will, soon.
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »