I'm thinking that you may use a app helper for that.

Let's say that you are using erb, you may have something like that:

app/views/
  shared/
    _foo.html.erb
    _bar.html.erb
  v1/
    some.html.erb
  v2/
    some.html.erb

You can implement a simple helper like that:

<%= shared 'foo' %>

And use something like that:

def shared(template, *options)
  # You may have business rules here to discover the path.
  render "shared/#{template}", *options
end


You aren't probably using ERB but you have similar ways to accomplish the same 
helper feature in almost all of them.

That is not enough?


I'm not against symlink functionality (I'm not even in the core xD), I'm just 
trying to understand your requirement here.

> On 31 Aug 2017, at 11:04, Andrew Kaspick <akasp...@gmail.com> wrote:
> 
> Sounds like some pretty specific requirements for what you need which is a 
> good candidate for an external gem.
> 
> On Thu, Aug 31, 2017 at 10:22 AM, Cory Gwin <gwincr...@gmail.com 
> <mailto:gwincr...@gmail.com>> wrote:
> I also think partials will be problematic because we don't want the templates 
> themselves to be in the look up path for Rails.
> 
> 
> On Wednesday, August 30, 2017 at 9:21:44 AM UTC-4, 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 
> <mailto:rubyonrails-core+unsubscr...@googlegroups.com>.
> To post to this group, send email to rubyonrails-core@googlegroups.com 
> <mailto:rubyonrails-core@googlegroups.com>.
> Visit this group at https://groups.google.com/group/rubyonrails-core 
> <https://groups.google.com/group/rubyonrails-core>.
> For more options, visit https://groups.google.com/d/optout 
> <https://groups.google.com/d/optout>.
> 
> 
> --
> You received this message because you are subscribed to a topic in the Google 
> Groups "Ruby on Rails: Core" group.
> To unsubscribe from this topic, visit 
> https://groups.google.com/d/topic/rubyonrails-core/5oNEFAMLvT8/unsubscribe 
> <https://groups.google.com/d/topic/rubyonrails-core/5oNEFAMLvT8/unsubscribe>.
> To unsubscribe from this group and all its topics, send an email to 
> rubyonrails-core+unsubscr...@googlegroups.com 
> <mailto:rubyonrails-core+unsubscr...@googlegroups.com>.
> To post to this group, send email to rubyonrails-core@googlegroups.com 
> <mailto:rubyonrails-core@googlegroups.com>.
> Visit this group at https://groups.google.com/group/rubyonrails-core 
> <https://groups.google.com/group/rubyonrails-core>.
> For more options, visit https://groups.google.com/d/optout 
> <https://groups.google.com/d/optout>.

-- 
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.

Attachment: signature.asc
Description: Message signed with OpenPGP

Reply via email to