teamon

  • Archive
  • RSS
  • Ask me anything

Better (scoped) rails engines routing

Rails engines are really great, but they are missing one thing - putting in router scope. Fortunately, this can be easily fixed.

Instead of engine`s config/routes.rb file put all router stuff in lib/engine.rb like that:

And now it is possible to add scope:

Done!

Example gist
    • #ruby
    • #rails
    • #engines
  • 1 year ago
  • Comments
  • Permalink
  • Share
    Tweet

Recent comments

Blog comments powered by Disqus
← Previous • Next →

About

Ruby, Scala and others.

Pages

  • About
  • Projects
  • RSS
  • Random
  • Archive
  • Ask me anything
  • Mobile

Effector Theme by Carlo Franco.

Powered by Tumblr