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

Simplify the view generator with scoped views

This commit is contained in:
Carlos Antonio da Silva 2020-06-07 19:12:40 -03:00
parent bbbff3a350
commit 14a3084b59

View file

@ -42,7 +42,7 @@ module Devise
def view_directory(name, _target_path = nil) def view_directory(name, _target_path = nil)
directory name.to_s, _target_path || "#{target_path}/#{name}" do |content| directory name.to_s, _target_path || "#{target_path}/#{name}" do |content|
if scope if scope
content.gsub("devise/shared/links", "#{plural_scope}/shared/links").gsub("devise/shared/error_messages", "#{plural_scope}/shared/error_messages") content.gsub("devise/shared", "#{plural_scope}/shared")
else else
content content
end end