Class: Jpmobile::Sinatra::Base
- Inherits:
-
Sinatra::Base
- Object
- Sinatra::Base
- Jpmobile::Sinatra::Base
- Defined in:
- lib/jpmobile/sinatra.rb
Instance Method Summary collapse
-
#find_template(views, name, engine) ⇒ Object
Calls the given block for every possible template file in views, named name.ext, where ext is registered on engine.
Instance Method Details
#find_template(views, name, engine) ⇒ Object
Calls the given block for every possible template file in views, named name.ext, where ext is registered on engine.
6 7 8 9 10 11 12 13 |
# File 'lib/jpmobile/sinatra.rb', line 6 def find_template(views, name, engine) if env['rack.jpmobile'] && !env['rack.jpmobile'].variants.empty? env['rack.jpmobile'].variants.each do |variant| yield ::File.join(views, "#{name}_#{variant}.#{@preferred_extension}") end end super end |