Skip to content

Latest commit

 

History

History
98 lines (68 loc) · 1.9 KB

File metadata and controls

98 lines (68 loc) · 1.9 KB

[v0.3.0] - 2021-08-30

NEW

  • root helper will raise a syntax error indicating that it should be used outside of modular_routes block.

  • concern and concerns support:

    modular_routes do
      concern :commentable do
        resource :comments
      end
    
      concern :activatable do
        member do
          put :activate
          put :deactivate
        end
      end
    
      resources :articles, concerns: :activatable do
        concerns :commentable
      end
    end

[v0.2.0] - 2021-07-21

REMOVED

  • modular_route helper was removed due to lack of syntax flexibility and a bit of inline verbosity.

NEW

  • modular_routes helper was added to fix the problems encountered on the previous helper. Check the example below:

    modular_routes do
      resources :books
    
      get :about, to: "about#index"
    end

    The idea was to bring simplicity and proximity to what you already write in your routes file.

  • namespace support`

    namespace :v1 do
      resources :books
    end

    It falls back to Rails default behavior.

  • scope support

    scope :v1 do
      resources :books
    end
    
    scope module: :v1 do
      resources :books
    end

    It falls back to Rails default behavior. In this example it recognizes /v1/books and /books expecting BooksController and V1::BooksController respectively.

  • Nested resources support

    modular_routes do
      resources :books do
        resources :comments
      end
    end

    It recognizes paths like /books/1/comments/2.

  • Standalone (non-resourceful) routes

    modular_routes do
      get :about, to: "about#index"
    end

    It expects About::IndexController to exist in controllers/about/index_controller.rb. They don't belong to a resourceful scope.

    If to doesn't match controller#action pattern, it falls back to Rails default behavior.

[0.1.1] - 2021-07-15

  • Initial release