Customization - AlyBadawy/Securial GitHub Wiki
🔧 Customization
Securial is designed to be flexible and developer-friendly. Whether you're tweaking API responses, modifying email templates, or replacing entire view layers, the engine allows you to override almost everything. You can selectively copy and customize views, or rely on the built-in defaults where appropriate. This page outlines how to get started with customizing views in your host application.
👀 Customizing Views
Securial ships with sensible defaults, but it’s easy to tailor the engine to your application’s needs.
Securial provides a generator that copies all built-in views from the engine into your application, allowing you to customize them as needed.
📦 Install views
To copy all Securial views — including both:
- Model views (e.g.,
*.json.jbuilder
templates used for API responses), - Mailer views (email templates like password reset and confirmation),
Run the following command from your host application:
rails generate securial:install:views
This will copy the entire contents of the engine’s views into your host application’s
app/views/securial/`.
🧩 Customization & Fallback Behavior
- Once views are copied, you can edit them freely to customize JSON responses, email content, and formatting.
- If you only need to override certain views, feel free to:
- Leave the others untouched, or
- Delete any copied view files you don’t need to modify — Rails will automatically fall back to the default views provided by the Securial engine.
- This makes it easy to maintain minimal overrides while keeping the rest of the engine’s behavior intact.
⚙️ Overriding controllers & models
Securial’s controllers and models live under the Securial
namespace. You can subclass a controller in your app to override or extend its behaviour. For example, you might want to record metrics when users log in or add extra fields to the user model. Remember to call super
where needed.