We are using Rails to serve static templates from a Git repo. We have template writers who are writing Ditta style templates that are single sourced. What this means is that they write a template that may be used in various versions of documentation which will live at different urls, ie /v2/template or /v3/template. The source templates live in a /content folder, to simplify their site structuring we are considering having the site live in a separate folder holding its own directory structure with content templates symlinked so they can be in multiple locations inside the site's structure. I have written a controller and associated prepend view path rule and route to know how to resolve the correct template from that structure.
While partials could work, from a template writing perspective it adds a fair amount of overhead, also symlinks are well understood and a first class citizen of most file systems. On Thursday, August 31, 2017 at 7:44:45 AM UTC-4, Gabriel Sobrinho wrote: > > Why aren't partials a good option? > > On Wednesday, August 30, 2017 at 10:21:44 AM UTC-3, Cory Gwin wrote: >> >> Hello, >> >> I am exploring a possible feature for an app I am working on. Ideally we >> would like to be able to symlink templates so we can use them in multiple >> paths easily, partials are not really a good option for our use case. I >> have written a custom template resolver built on top of >> ActionView::PathResolver to accomplish this. I was speaking with >> eileencodes about this feature and trying to explore the idea of Rails >> having native support for this, she said I should start a discussion here. >> >> What do people think? I would love to have this natively supported and >> would be more than happy to work on a PR. >> >> Thanks, >> Cory >> > -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-core+unsubscr...@googlegroups.com. To post to this group, send email to rubyonrails-core@googlegroups.com. Visit this group at https://groups.google.com/group/rubyonrails-core. For more options, visit https://groups.google.com/d/optout.