Class: SimplePaginate::Generators::ViewsGenerator

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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

:nodoc:



9
10
11
12
13
14
15
# File 'lib/generators/simple_paginate/views_generator.rb', line 9

def self.banner #:nodoc:
  <<-BANNER.chomp
rails g simple_paginate:views [options]

    Copies all paginator partial templates to your application.
BANNER
end

Instance Method Details

#copy_viewsObject



17
18
19
20
21
22
# File 'lib/generators/simple_paginate/views_generator.rb', line 17

def copy_views
  filename_pattern = File.join self.class.source_root, "*.html.#{template_engine}"
  Dir.glob(filename_pattern).map {|f| File.basename f}.each do |f|
    copy_file f, "app/views/simple_paginate/#{f}"
  end
end