How to add dynamics routes in my app

Hi, I Want to add dynamics routes in my App( She's in Rails 3 ) , Indeed my objective is to load dynamicaly routes because of user action. I've already make works the solution to open and inject code into route.rb But it seems not clean in my opinion?

Sorry for my english

Thx