Class: SmartListing::Generators::ViewsGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- SmartListing::Generators::ViewsGenerator
- Defined in:
- lib/generators/smart_listing/views_generator.rb
Class Method Summary collapse
-
.banner ⇒ Object
:nodoc:.
Instance Method Summary collapse
Class Method Details
.banner ⇒ Object
:nodoc:
6 7 8 9 10 11 12 |
# File 'lib/generators/smart_listing/views_generator.rb', line 6 def self. #:nodoc: <<-BANNER.chomp rails g smart_listing:views Copies all smart listing partials templates to your application. BANNER end |
Instance Method Details
#copy_views ⇒ Object
15 16 17 18 19 20 |
# File 'lib/generators/smart_listing/views_generator.rb', line 15 def copy_views filename_pattern = File.join self.class.source_root, "*.html.erb" Dir.glob(filename_pattern).map {|f| File.basename f}.each do |f| copy_file f, "app/views/smart_listing/#{f}" end end |