Skip to content

alessiosantocs/multiple_routes

Repository files navigation

MultipleRoutes

Install this gem if you want to manage your app's routes in a smarter way. You'll be able to split routes files into a routes folder and keep everything tidy and clean.

Installation

Go for it, install like this:

gem 'multiple_routes' # In your gemfile

Then bundle install.

Usage

Simply create a folder in your config/ called routes and create any file as follows:

# config/routes/api.rb
namespace :api, defaults: {format: 'json'} do
    namespace :v1 do
        resources :posts do
            # Whatever...
        end
    end
end

Then in your routes.rb file:

Deploydapp::Application.routes.draw do
    # example posts resource
    resources :posts do
        resources :pull_requests
    end
    # Api namespace
    draw :api
end

About

Split your app's routes into different files

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages