Features - lstpsche/webring-rails GitHub Wiki
Webring for Rails provides the following features:
Core Features
-
Complete Model-Controller structure for managing webring members
- Member model with UID generation and validation
- Navigation controller for webring traversal
- Members controller with full CRUD functionality
- Status management with
active
anddisabled
states for member control
-
Circular navigation system between member websites
- Navigation module provides next/previous/random traversal
- Status-aware navigation that automatically excludes disabled members
- Secure redirections with
allow_other_host
support - Handles edge cases when members are added or removed
-
Streamlined routing configuration with
webring_routes
helper- One-line setup: Similar to Devise's
devise_for
approach - Customizable controllers: Easy switching between default and custom controllers
- Flexible configuration: Control mount paths, skip components, and more
- Route consistency: Ensures all webring routes are configured correctly
- One-line setup: Similar to Devise's
-
UID-based member identification for security
- 32-character hexadecimal unique identifiers
- Prevents sequential ID enumeration attacks
- Automatic generation for new members
-
Member status management for webring administration
active
anddisabled
status states- Easy toggling between states using enum methods
- Status tracking in database with proper defaults
-
Embeddable JavaScript widget for easy member site integration
- Widget controller
- Customizable appearance and behavior
- Server-side customization including logo replacement
- Optional metrics tracking for widget usage analytics
-
Optional membership request system
- MembershipRequest model for handling join requests
- MembershipRequests controller for submitting requests
- Simple approval workflow for managing new members
Routing Configuration
webring_routes Helper
The webring_routes
helper method provides a Devise-like approach to configuring webring routes:
# Basic usage - sets up all default routes
webring_routes
# Custom controllers
webring_routes navigation: :custom_navigation, widget: :custom_widget
# Advanced configuration
webring_routes(
mount_path: 'network'
)
Benefits:
- Cleaner routes.rb: Single line replaces dozens of route declarations
- Consistent setup: Ensures all necessary routes are configured correctly
- Easy customization: Simple options for common configuration needs
- Future-proof: Route changes are handled automatically in gem updates
Generators
WebringRails provides several generators to help you set up webring functionality in your application:
-
Member Model Generator: Creates the Webring::Member model with necessary fields
rails generate webring:member
-
Navigation Controller Generator: Creates the navigation controller with navigation actions
rails generate webring:navigation_controller
-
Membership Request Generator: Creates the MembershipRequest model for handling join requests
rails generate webring:membership_request
-
Membership Requests Controller Generator: Creates the controller for handling membership requests
rails generate webring:membership_requests_controller
-
Custom Widget Controller Generator: Creates a controller for customizing the webring widget
rails generate webring:custom_widget_controller
-
Installation Generator (Legacy): Manually mounts the Webring engine in routes.rb
rails generate webring:install # Only needed for manual setup
[!TIP] The installation generator is no longer needed when using the
webring_routes
helper. Simply addwebring_routes
to your routes.rb file instead.
See Installation for detailed setup instructions.
For development information and contributing to the gem, see Development.