class GuiderCms::Generators::ViewsGenerator

Public Instance Methods

copy_views() click to toggle source
# File lib/generators/guider_cms/views_generator.rb, line 12
def copy_views
  view_directory :articles
  view_directory :categories
  view_directory :subcategories
end

Protected Instance Methods

plural_scope() click to toggle source
# File lib/generators/guider_cms/views_generator.rb, line 30
def plural_scope
  @plural_scope ||= scope.presence && scope.underscore.pluralize
end
target_path() click to toggle source
# File lib/generators/guider_cms/views_generator.rb, line 26
def target_path
  @target_path ||= "app/views/#{plural_scope}"
end
view_directory(name, _target_path = nil) click to toggle source
# File lib/generators/guider_cms/views_generator.rb, line 20
def view_directory(name, _target_path = nil)
  directory name.to_s, _target_path || "#{target_path}/guider_cms/#{name}" do |content|
    content
  end
end