Switch between 2 or more templates with an action in controllers?

Viewed 308

I have a default Phoenix application. This app will have a page_controller which will load an index.html.eex file.

The app will know to use the view to access templates/page/index.html.eex.

Now say you have created another html page which is identical to index.html.eex in every way except it is in French.

As we do not want to create a whole new Phoenix application which will have all the same code, with the exception being the French translation of the current page/index.html.eex, is there a way to tell the view or the controller which file needs to be loaded.

Is there a plug which can be placed in the router to alter where render will look for it's templates?

2 Answers
Related