# 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:

```ruby
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:

```ruby
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.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.consuldemocracy.org/tech_docs/customization/routes.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
