Class: UniRails::App::Views

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/uni_rails/app/views.rb

Constant Summary collapse

DEFAULT_LAYOUT =
<<~HTML
  <!DOCTYPE html>
  <html>
    <head>
      <title>Template</title>
      <meta name="viewport" content="width=device-width,initial-scale=1">
      <%= csrf_meta_tags %>
      <%= csp_meta_tag %>

      <%= uni_rails_css_stylesheet %>
      <%= uni_rails_import_map_tag %>
      <%= uni_rails_javascript_script %>
    </head>

    <body>
      <%= yield %>
    </body>
  </html>
HTML

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeViews

Returns a new instance of Views.



27
28
29
# File 'lib/uni_rails/app/views.rb', line 27

def initialize
  @views = { 'layouts/application.html.erb' => DEFAULT_LAYOUT }
end

Instance Attribute Details

#viewsObject

Returns the value of attribute views.



26
27
28
# File 'lib/uni_rails/app/views.rb', line 26

def views
  @views
end

Class Method Details

.view_pathsObject



31
32
33
# File 'lib/uni_rails/app/views.rb', line 31

def self.view_paths
  [ActionView::FixtureResolver.new(instance.views)]
end