Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

25 lines (19 sloc) 0.795 kB
module Devise
module Generators
class DeviseGenerator < Rails::Generators::NamedBase
include Rails::Generators::ResourceHelpers
namespace "devise"
source_root File.expand_path("../templates", __FILE__)
desc "Generates a model with the given NAME (if one does not exist) with devise " <<
"configuration plus a migration file and devise routes."
hook_for :orm
class_option :routes, :desc => "Generate routes", :type => :boolean, :default => true
def add_devise_routes
devise_route = "devise_for :#{plural_name}"
devise_route << %Q(, :class_name => "#{class_name}") if class_name.include?("::")
devise_route << %Q(, :skip => :all) unless options.routes?
route devise_route
end
end
end
end
Jump to Line
Something went wrong with that request. Please try again.