Class: SimplePaginate::Generators::ViewsGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- SimplePaginate::Generators::ViewsGenerator
- Defined in:
- lib/generators/simple_paginate/views_generator.rb
Class Method Summary collapse
-
.banner ⇒ Object
:nodoc:.
Instance Method Summary collapse
Class Method Details
.banner ⇒ Object
:nodoc:
9 10 11 12 13 14 15 |
# File 'lib/generators/simple_paginate/views_generator.rb', line 9 def self. #:nodoc: <<-BANNER.chomp rails g simple_paginate:views [options] Copies all paginator partial templates to your application. BANNER end |
Instance Method Details
#copy_views ⇒ Object
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 |