Class: Ditty::Application
- Inherits:
-
Sinatra::Base
- Object
- Sinatra::Base
- Ditty::Application
- Includes:
- ActiveSupport::Inflector
- Defined in:
- lib/ditty/controllers/application.rb
Instance Method Summary collapse
Instance Method Details
#find_template(views, name, engine, &block) ⇒ Object
74 75 76 77 78 79 80 81 82 |
# File 'lib/ditty/controllers/application.rb', line 74 def find_template(views, name, engine, &block) # Backwards compatability return super(views, name, engine, &block) if settings.view_folder.nil? && self.class.name.split('::').first != 'Ditty' view_folders.each do |folder| super(folder, name, engine, &block) # Root end raise Ditty::TemplateNotFoundError, "Could not find template `#{name}`" end |
#view_folders ⇒ Object
68 69 70 71 72 |
# File 'lib/ditty/controllers/application.rb', line 68 def view_folders folders = ['./views'] folders << settings.view_folder if settings.view_folder folders << Ditty::App.view_folder end |