当前位置: 动力学知识库 > 问答 > 编程问答 >

ruby - Inline templating does not work along with modularity?

问题描述:

I'm making a modular application:

main.rb

require "sinatra/namespace"

require "haml"

Dir.glob("servers/*/server.rb").each do |server|

require_relative server

end

And I want to do inline templating:

servers/some/server.rb

namespace "/some/hello" do

get "/" do

haml :index

end

end

__END__

@@ index

!!!

%html

hello

But I get the:

No such file or directory - views/index.haml

It works if I move the template to main.rb but then it's kinda not modular anymore.

分享给朋友:
您可能感兴趣的文章:
随机阅读: