Customize a Resourcesful Action
This document outlines how to customize a resourcesful action e.g. show:
Assume that:
- Wallaby is mounted at
/admin - ActiveRecord model is
Product
To customize the resourcesful action show, the steps are:
Create a custom controller inheriting from the admin interface application controller as
app/controllers/admin/products_controller.rb:class Admin::ProductsController < Admin::ApplicationController endNOTE:
Admin::ApplicationControllercan be replaced withWallaby::ResourcesControllerif it doesn’t exist.Create the action method
show:class Admin::ProductsController < Admin::ApplicationController def show # override the original method end end