Overriding Templates
Customize any part of Omaship by creating files in your app that override the engine defaults.
How Overriding Works
Rails looks for views in your app first, then falls back to the engine. To override a template, create a file at the same path in your app.
Example: Customize the Homepage
The engine provides a default homepage at:
gems/omaship_base/app/views/pages/home.html.erb
To override it, create your own file at:
app/views/pages/home.html.erb
Your version takes precedence. The engine version is ignored.
Finding Templates to Override
To see all available templates:
bundle show omaship_base
# Then browse the app/views directory
Overriding Partials
You can override individual partials without replacing entire views:
# Override just the header
app/views/shared/_header.html.erb
# Override just the footer
app/views/shared/_footer.html.erb
Overriding Controllers
For deeper customization, override controllers:
# app/controllers/pages_controller.rb
class PagesController < OmashipBase::PagesController
def home
# Your custom logic
super # Call the engine's version too, or don't
end
end
Styling
Add custom styles in app/assets/stylesheets/application.css. Tailwind classes are available throughout.