Skip to content

Commit

Permalink
bump version 0.3.0
Browse files Browse the repository at this point in the history
Signed-off-by: Vítor Avelino <contact@vitoravelino.me>
  • Loading branch information
vitoravelino committed Aug 31, 2021
1 parent 874d179 commit 099f854
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 22 deletions.
67 changes: 47 additions & 20 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,30 @@
## [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:

```ruby
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**
Expand All @@ -9,57 +36,57 @@
- `modular_routes` helper was added to fix the problems encountered on the previous helper. Check the example below:

```ruby
modular_routes do
resources :books
modular_routes do
resources :books
get :about, to: "about#index"
end
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`
```ruby
namespace :v1 do
resources :books
end
namespace :v1 do
resources :books
end
```

It falls back to Rails default behavior.

- `scope` support

```ruby
scope :v1 do
resources :books
end
scope :v1 do
resources :books
end
scope module: :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

```ruby
modular_routes do
resources :books do
resources :comments
end
modular_routes do
resources :books do
resources :comments
end
end
```

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

- Standalone (non-resourceful) routes

```ruby
modular_routes do
get :about, to: "about#index"
end
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.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ resources :articles, concerns: [:activatable]

# or

resources :articles do
resources :articles, concerns: :activatable do
concerns :commentable
end
```
Expand Down
2 changes: 1 addition & 1 deletion lib/modular_routes/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module ModularRoutes
VERSION = "0.2.0"
VERSION = "0.3.0"
end

0 comments on commit 099f854

Please sign in to comment.