In my Rails 7 app I have the following routes set up:
Rails.application.routes.draw do
scope 'account/:current_account' do
resources :clients
end
end
This will, for example, generate a route like this:
/account/:current_account/clients(.:format)
In my ApplicationController I have url_options
set up in order to keep @current_account
in every request.
class ApplicationController < ActionController::Base
def url_options
{:current_account => @current_account}.merge(super)
end
end
This works fine throughout the entire app, except in all the mailers.
Whenever I try to trigger an email I am getting this error:
possible unmatched constraints: [:current_account]
How can I get this working with all my Mailers too?