1
0
Fork 0
mirror of https://github.com/heartcombo/devise.git synced 2022-11-09 12:18:31 -05:00
heartcombo--devise/generators/devise_views/devise_views_generator.rb

25 lines
659 B
Ruby
Raw Normal View History

2009-10-23 11:01:55 -02:00
class DeviseViewsGenerator < Rails::Generator::Base
def manifest
record do |m|
views_directory = File.join('app', 'views')
m.directory views_directory
{
:sessions => [:new],
:passwords => [:new, :edit],
:confirmations => [:new],
:notifier => [:confirmation_instructions, :reset_password_instructions]
}.each do |dir, templates|
m.directory File.join(views_directory, dir.to_s)
templates.each do |template|
template_path = "#{dir}/#{template}.html.erb"
m.file "#{template_path}", "#{views_directory}/#{template_path}"
end
end
end
end
end