Class: Rails::Datatable::InstallGenerator

Inherits:
Generators::Base
  • Object
show all
Defined in:
lib/generators/rails/datatable/install_generator.rb

Instance Method Summary collapse

Instance Method Details

#init_datatableObject



8
9
10
11
# File 'lib/generators/rails/datatable/install_generator.rb', line 8

def init_datatable
  empty_directory 'app/datatables'
  template "datatable.rb", "app/datatables/datatable.rb"
end

#insert_jquery_datatable_jsObject



13
14
15
16
17
18
# File 'lib/generators/rails/datatable/install_generator.rb', line 13

def insert_jquery_datatable_js
  insert_into_file(
    'app/assets/javascripts/application.js',
    "\n//= require jquery\n//= require jquery.dataTables.min\n//= require datatable"
  )
end