Class: Overlastic::ViewsGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/overlastic/views/views_generator.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.default_generator_rootObject



6
7
8
# File 'lib/generators/overlastic/views/views_generator.rb', line 6

def self.default_generator_root
  __dir__
end

Instance Method Details

#copy_view_filesObject



10
11
12
13
14
15
16
17
18
19
20
# File 'lib/generators/overlastic/views/views_generator.rb', line 10

def copy_view_files
  copy_file "#{options[:css]}/_dialog.html.erb", "app/views/overlays/_dialog.html.erb"
  copy_file "#{options[:css]}/_pane.html.erb", "app/views/overlays/_pane.html.erb"

  create_file "config/initializers/overlastic.rb", <<~RUBY
    Overlastic.configure do |config|
      config.dialog_overlay_view_path = "overlays/dialog"
      config.pane_overlay_view_path = "overlays/pane"
    end
  RUBY
end