Module: Securial::Helpers::RolesHelper
Overview
Helper methods for role management and formatting.
This module provides utility methods for working with user roles, including namespace generation for protected routes and role name formatting for user interfaces. It centralizes role-related logic to ensure consistent behavior across the application.
Instance Method Summary collapse
-
#protected_namespace ⇒ String
Generates a namespace string for protected admin routes.
-
#titleized_admin_role ⇒ String
Formats the admin role name for user interface display.
Instance Method Details
#protected_namespace ⇒ String
Generates a namespace string for protected admin routes.
Converts the configured admin role into a pluralized, underscored namespace suitable for use in Rails routing and controller organization. This ensures admin routes are consistently organized under the appropriate namespace.
53 54 55 |
# File 'lib/securial/helpers/roles_helper.rb', line 53 def protected_namespace Securial.configuration.admin_role.to_s.strip.underscore.pluralize end |
#titleized_admin_role ⇒ String
Formats the admin role name for user interface display.
Converts the configured admin role into a human-readable, title-cased string suitable for display in user interfaces, form labels, and user-facing messages.
80 81 82 |
# File 'lib/securial/helpers/roles_helper.rb', line 80 def titleized_admin_role Securial.configuration.admin_role.to_s.strip.titleize end |