Hello, I have a couple of style which I need to load in my site head tag, but I needn’t it to load all of my pages, for this purpose I’m finding the way that it just loads in the controller concerned, for example this code should be loaded when my user load BlogController or view or template, each element can load those.
I have read these link:
and found blog_path but it didn’t work for me because you think I have this router:
name.com/blog/:alias_link
I need it to be loaded in all of the link not just ID 3, when I print blog_path , it shows me like this:
/blog if my user enters link like /blog/ , it won’t work
the code whether this is a BlogController or not?:
You can use Phoenix.Controller.controller_module(conn) to get the controller module and include stuff based on that. You could also move this into a view function and use that instead. Phoenix.Controller — Phoenix v1.8.8