Plugin i routing

czesc

dodawanie w pluginie urls do railsowego routingu jest takie:

module Yaffle module Routing module MapperExtensions def yaffles @set.add_route("/yaffles", {:controller => "yaffles", :action => "index"}) end end end end ActionController::Routing::RouteSet::Mapper.send :include, Yaffle::Routing::MapperExtensions
a moje pytanie to:
jak dodac (map.resources) to tworzonego pluginu, aby nie tworzyc recznie kolejnych urlow?

@set.add_route("/yaffles", {:controller => "yaffles", :action => "index"}) @set.add_route("/yaffles/:id(.:format)", {:controller => "yaffles", :action => "show"}) i tak dalej ...
(* poza tym map.resources tworzy jeszcze helpery do url’ow)

dzieki

Zainspiruj się, tym jak jest to zrobione np w clearance:
http://github.com/thoughtbot/clearance/blob/master/lib/clearance/routes.rb

dzieki