Class: Kaminari::Generators::ViewsGenerator
- Inherits:
-
Rails::Generators::NamedBase
- Object
- Rails::Generators::NamedBase
- Kaminari::Generators::ViewsGenerator
- Defined in:
- lib/generators/kaminari/views_generator.rb
Overview
rails g kaminari:views THEME
Class Method Summary collapse
-
.banner ⇒ Object
:nodoc:.
Instance Method Summary collapse
-
#copy_or_fetch ⇒ Object
:nodoc:.
Class Method Details
.banner ⇒ Object
:nodoc:
12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/generators/kaminari/views_generator.rb', line 12 def self. #:nodoc: <<-BANNER.chomp rails g kaminari:views THEME [options] Copies all paginator partial templates to your application. You can choose a template THEME by specifying one from the list below: - default The default one. This one is used internally while you don't override the partials. #{themes.map {|t| " - #{t.name}\n#{t.description}"}.join("\n")} BANNER end |
Instance Method Details
#copy_or_fetch ⇒ Object
:nodoc:
27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/generators/kaminari/views_generator.rb', line 27 def copy_or_fetch #:nodoc: return copy_default_views if file_name == 'default' if (theme = self.class.themes.detect {|t| t.name == file_name}) if download_templates(theme).empty? say "template_engine: #{template_engine} is not available for theme: #{file_name}" end else say "no such theme: #{file_name}\n available themes: #{self.class.themes.map(&:name).join ', '}" end end |