lib/generators/devise/views_generator.rb in devise-2.2.3 vs lib/generators/devise/views_generator.rb in devise-2.2.4
- old
+ new
@@ -16,11 +16,11 @@
class_option :markerb
public_task :copy_views
end
- # TODO: Add this to Rails itslef
+ # TODO: Add this to Rails itself
module ClassMethods
def hide!
Rails::Generators.hide_namespace self.namespace
end
end
@@ -34,10 +34,16 @@
end
protected
def view_directory(name, _target_path = nil)
- directory name.to_s, _target_path || "#{target_path}/#{name}"
+ directory name.to_s, _target_path || "#{target_path}/#{name}" do |content|
+ if scope
+ content.gsub "devise/shared/links", "#{scope}/shared/links"
+ else
+ content
+ end
+ end
end
def target_path
@target_path ||= "app/views/#{scope || :devise}"
end