Last active
August 29, 2015 13:58
-
-
Save awilkening/9980677 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I would like to locate a partial in the app/views dir to be shared by two name spaces. How can I link the missing partials, (lostees or others)/trees/tree.html.haml to trees/tree.html.haml? | |
# config/routes.rb | |
namespace :lostees do | |
resources :islands | |
end | |
namespace :others do | |
resources :islands | |
end | |
# app/controllers/lostees/islands_controller.rb | |
class Lostees::IslandsController < Lostees::BaseController | |
end | |
# app/controllers/others/islands_controller.rb | |
class Lostees::IslandsController < Others::BaseController | |
end | |
# app/views/trees/_tree.html.haml | |
= content_tag_for tree do | |
= tree.name | |
# app/views/lostees/islands/show.html.haml | |
%h2 The Island | |
%div Trees | |
= render island.trees | |
#=> Missing partial lostess/trees/tree | |
# app/views/others/islands/show.html.haml | |
%h2 The Island | |
%div Trees | |
= render island.trees | |
#=> Missing partial others/trees/tree | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment