Technical Documentation
Return to Main Documentation
ENGLISH - version 2.3
ENGLISH - version 2.3
  • Introduction
  • Getting started
    • Create your fork
    • Configure your fork
    • Keep your fork updated
    • Communication
  • Installation
    • Local installation
      • Prerequisites
      • Ubuntu Linux
      • Debian Linux
      • macOS
      • Windows
      • Vagrant
      • Docker
    • Production and staging servers
      • Installer
      • Create a deploy user
      • Generating SSH Key
      • Manual installation (not recommended)
      • Digital Ocean
      • Heroku
      • Mail server configuration
    • Basic configuration
    • User documentation and guides
  • Customization
    • Introduction
    • Translations and texts
    • Images
    • Styles with CSS
    • JavaScript
    • Models
    • Controllers
    • Views and HTML
    • Components
    • Other Ruby classes (GraphQL, lib, mailers, builders)
    • Gems
    • Application configuration
    • Routes
    • Tests
  • Technical Features
    • OAuth
    • GraphQL
    • Debates and proposals recommendations
    • Configure Census Connection
    • Local Census
    • Multitenancy
    • User content translations
  • Open Source project
    • Code of conduct
    • Contributing
    • Coding conventions
    • Open source forks and modifications
    • License
Powered by GitBook
On this page
  1. Customization

Components

PreviousViews and HTMLNextOther Ruby classes (GraphQL, lib, mailers, builders)

Last updated 6 months ago

CtrlK

For components, customization can be used to change both the logic (included in a .rb file) and the view (included in a .erb file). If you only want to customize the logic for, let's say, the Admin::TableActionsComponent, create a file named app/components/custom/admin/table_actions_component.rb with the following content:

load Rails.root.join("app", "components", "admin", "table_actions_component.rb")

class Admin::TableActionsComponent
  # Your custom logic here
end

Check the models customization section for more information about customizing Ruby classes.

If, on the other hand, you also want to customize the view, you need a small modification. Instead of the previous code, use:

class Admin::TableActionsComponent < ApplicationComponent; end

load Rails.root.join("app", "components", "admin", "table_actions_component.rb")

class Admin::TableActionsComponent
  # Your custom logic here
end

This will make the component use the view in app/components/custom/admin/table_actions_component.html.erb. You can create this file and customize it to your needs, the same way you can customize views.