module SigbitAdminRails::Generators::ViewPathTemplates

Public Instance Methods

copy_views() click to toggle source
# File lib/generators/sigbit_admin_rails/views_generator.rb, line 16
def copy_views
  view_directory :sessions
  view_directory :passwords
end

Protected Instance Methods

plural_scope() click to toggle source
# File lib/generators/sigbit_admin_rails/views_generator.rb, line 37
def plural_scope
  @plural_scope ||= scope.presence && scope.underscore.pluralize
end
target_path() click to toggle source
# File lib/generators/sigbit_admin_rails/views_generator.rb, line 33
def target_path
  @target_path ||= "app/views/#{plural_scope ||= :devise}"
end
view_directory(name, _target_path = nil) click to toggle source
# File lib/generators/sigbit_admin_rails/views_generator.rb, line 23
def view_directory(name, _target_path = nil)
  directory name.to_s, _target_path || "#{target_path}/#{name}" do |content|
    if scope
      content.gsub "devise/shared/links", "#{plural_scope}/shared/links"
    else
      content
    end
  end
end