
Security News
CISA’s 2025 SBOM Guidance Adds Hashes, Licenses, Tool Metadata, and Context
CISA’s 2025 draft SBOM guidance adds new fields like hashes, licenses, and tool metadata to make software inventories more actionable.
Friendly Routes creates DSL for creating rails routes with human friendly URLs
How to use my plugin.
Add this line to your application's Gemfile:
gem 'friendly_routes'
And then execute:
$ bundle
Or install it yourself as:
$ gem install friendly_routes
# config/routes.rb
free = FriendlyRoutes::Params::BooleanParams.new(:free, true: :free, false: :paid)
category = FriendlyRoutes::Params::CollectionParams.new(:category_id, Category, :title)
dummies_route = FriendlyRoutes::Route.new([free, category], controller: :dummies, action: :index)
friendly_url_for dummies_route, :get # '/:free/:category'
second_dummies_route = FriendlyRoutes::Route.new([free, 'categories', category], controller: :dummies, action: :index)
friendly_url_for dummies_route, :get, '/' # '/:free/categories/:category'
friendly_url_for dummies_route, :get, '/hello/' # '/hello/:free/categories/:category'
# app/controllers/dummies_controller.rb
class DummiesController < ApplicationController
before_action :parse_friendly_routes, only: [:index]
def index
end
end
Categories:
<Category id: 1, title: "lorem">
<Category id: 2, title: "ipsum">
GET "/free/lorem" - { free: true, category_id: 1}
GET "/free/ipsum" - { free: true, category_id: 2}
GET "/paid/lorem" - { free: false, category_id: 1}
GET "/paid/ipsum" - { free: false, category_id: 2}
Feel free to contribute into this repository by creating pull requests.
The gem is available as open source under the terms of the MIT License.
FAQs
Unknown package
We found that friendly_routes demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CISA’s 2025 draft SBOM guidance adds new fields like hashes, licenses, and tool metadata to make software inventories more actionable.
Security News
A clarification on our recent research investigating 60 malicious Ruby gems.
Security News
ESLint now supports parallel linting with a new --concurrency flag, delivering major speed gains and closing a 10-year-old feature request.