I created some custom content blocks for article and layout records. Unless a separate Rails::Engine is used to generate routes, it appears that content blocks must reside under the Cms:: namespace. By creating BcmsMy401k::Engine, I was able to establish the BcmsMy401k:: namespace. This also meant that I needed to add routes via BcmsMy401k::Engine instead of Rails::Application.
For some reason, however, the routes are being loaded twice. I will need to figure out why, but for now, I check to see if the routes were loaded already for the BcmsMy401k::Engine. I do this by analyzing the routes already drawn. I chose to check by using the ActionDispatch::Routing::RouteSet::NamedRouteCollection#names method. If the count is greater than 0, then they've already been loaded. The routes should only be loaded one time. This solution will allow me to move forward; I'll have to investigate a better solution later.
Related resources:
No comments:
Post a Comment