Skip to content

Commit

Permalink
Avoid to destroy app/controllers directory
Browse files Browse the repository at this point in the history
  • Loading branch information
Sylvain Claudel committed Sep 17, 2013
1 parent 2dfed94 commit 00b35fc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/generators/beautiful_scaffold_generator.rb
Expand Up @@ -174,7 +174,8 @@ def add_to_model
def generate_controller
copy_file "app/controllers/master_base.rb", "app/controllers/beautiful_controller.rb"
dirs = ['app', 'controllers', options[:namespace]].compact
empty_directory File.join(dirs)
# Avoid to remove app/controllers directory (https://github.com/rivsc/Beautiful-Scaffold/issues/6)
empty_directory File.join(dirs) if not options[:namespace].blank?
template "app/controllers/base.rb", File.join([dirs, "#{model_pluralize}_controller.rb"].flatten)
end

Expand Down

0 comments on commit 00b35fc

Please sign in to comment.