Class: AjaxPagination::Generators::AssetsGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/ajax_pagination/assets_generator.rb

Instance Method Summary (collapse)

Instance Method Details

- (Object) css



28
29
30
# File 'lib/generators/ajax_pagination/assets_generator.rb', line 28

def css
  copy_file "lib/assets/stylesheets/ajax_pagination.css", "public/stylesheets/ajax_pagination.css"
end

- (Object) img



31
32
33
# File 'lib/generators/ajax_pagination/assets_generator.rb', line 31

def img
  copy_file "lib/assets/images/ajax-loader.gif", "public/images/ajax-loader.gif"
end

- (Object) js



19
20
21
22
23
24
25
26
27
# File 'lib/generators/ajax_pagination/assets_generator.rb', line 19

def js
  jstemplate = ERB.new IO.read(File.expand_path("../../../assets/javascripts/ajax_pagination.js.erb",__FILE__))
  
  Dir.mkdir("public/javascripts") unless File.exists?("public/javascripts")

  create_file "public/javascripts/ajax_pagination.js", jstemplate.result(binding)
  copy_file "vendor/assets/javascripts/jquery.ba-bbq.js", "public/javascripts/jquery.ba-bbq.js"
  copy_file "vendor/assets/javascripts/jquery.url.js", "public/javascripts/jquery.url.js"
end