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

Routes

When adding custom controller actions, you also need to define a route to configure the URL that will be used for those actions. You can do so by editing the config/routes/custom.rb file.

For example, if you'd like to add a new section in the admin area to manage happy thoughts and verify they've become true, you can write:

namespace :admin do
  resources :happy_thoughts do
    member do
      put :verify
    end
  end
end

Or, if, for example, you'd like to add a form to edit debates in the admin area:

namespace :admin do
  resources :debates, only: [:edit, :update]
end

Doing so, the existing debates routes in the admin area will be kept, and the routes to edit and update them will be added.

Note that the routes you define on this file will take precedence over the default routes. So, if you define a route for /proposals, the default action for /proposals will not be used and the one you define will be used instead.

PreviousApplication configurationNextTests

Last updated 2 months ago