Skip to content

About

A simple library to help organize your Ruby on Rails routes into multiple files

Resources

Stars

3 stars

Watchers

3 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OrganizedRoutes

Tired of huge routes.rb files in your Rails apps? Then read on!

Overview

The organized_routes gem allows you to break your routes up into logical groups, organized in separate files.

Step 1) Add the library to your app

# Gemfile
gem "organized_routes", "~> 1.0.0"

Step 2) Define your routes under the config/routes directory

# config/routes/api.rb
OrganizedRoutes.define(:api) do
  namespace :api do
    resources :users
  end
end

Step 3) Include your routes by name in routes.rb

# config/routes/api.rb
Example::Application.routes.draw do
  organize_routes
  routes_for :api
end

That's all there is to it! Make sure to restart your app after any route changes.

Note: If anyone has suggestions for ways to avoid the organize_routes call I'm all ears.

About

A simple library to help organize your Ruby on Rails routes into multiple files

Resources

Stars

3 stars

Watchers

3 watching

Forks

Releases

Packages

Used by

Contributors

Languages