Sha256: 777cbf0e80be75b450f20a496615ae742e79fb57991a46b73339c8826facee79
Contents?: true
Size: 1.1 KB
Versions: 4
Compression:
Stored size: 1.1 KB
Contents
module Protected module Generators # Include this module in your generator to generate Devise views. # `copy_views` is the main method and by default copies all views # with forms. module ViewPathTemplates #:nodoc: extend ActiveSupport::Concern included do argument :scope, :required => false, :default => nil, :desc => "The scope to copy views to" public_task :copy_views end def copy_views view_directory :passwords view_directory :sessions view_directory :user_mailer view_directory :users end protected def view_directory(name, _target_path = nil) directory name.to_s, _target_path || "#{target_path}/#{name}" end def target_path @target_path ||= "app/views/#{scope || :protected}" end end class ViewsGenerator < Rails::Generators::Base #:nodoc: include ViewPathTemplates source_root File.expand_path("../../../../../app/views/protected", __FILE__) desc "Copies default Protected views to your application." end end end
Version data entries
4 entries across 4 versions & 1 rubygems