diff options
author | Ryan Bates <ryan@railscasts.com> | 2011-06-12 18:29:14 -0700 |
---|---|---|
committer | Ryan Bates <ryan@railscasts.com> | 2011-06-12 18:29:14 -0700 |
commit | 4dc3bb9cbdaefdedfdde9b0e2d088cbb16c4a55c (patch) | |
tree | 77bb294e47b5843b0dae39366d5a9522d3c84805 /railties/lib | |
parent | 86bbba1ffbd7bf695021d0e6c0f269f808304143 (diff) | |
download | rails-4dc3bb9cbdaefdedfdde9b0e2d088cbb16c4a55c.tar.gz rails-4dc3bb9cbdaefdedfdde9b0e2d088cbb16c4a55c.tar.bz2 rails-4dc3bb9cbdaefdedfdde9b0e2d088cbb16c4a55c.zip |
namespace engine assets
Diffstat (limited to 'railties/lib')
-rw-r--r-- | railties/lib/rails/generators/rails/plugin_new/plugin_new_generator.rb | 14 | ||||
-rw-r--r-- | railties/lib/rails/generators/rails/plugin_new/templates/app/views/layouts/application.html.erb.tt | 14 |
2 files changed, 21 insertions, 7 deletions
diff --git a/railties/lib/rails/generators/rails/plugin_new/plugin_new_generator.rb b/railties/lib/rails/generators/rails/plugin_new/plugin_new_generator.rb index 807350316c..7c0a2b9cf4 100644 --- a/railties/lib/rails/generators/rails/plugin_new/plugin_new_generator.rb +++ b/railties/lib/rails/generators/rails/plugin_new/plugin_new_generator.rb @@ -11,15 +11,15 @@ module Rails def app if mountable? directory "app" - template "#{app_templates_dir}/app/views/layouts/application.html.erb.tt", + template "app/views/layouts/application.html.erb.tt", "app/views/layouts/#{name}/application.html.erb" - empty_directory_with_gitkeep "app/assets/images" + empty_directory_with_gitkeep "app/assets/images/#{name}" elsif full? empty_directory_with_gitkeep "app/models" empty_directory_with_gitkeep "app/controllers" empty_directory_with_gitkeep "app/views" empty_directory_with_gitkeep "app/helpers" - empty_directory_with_gitkeep "app/assets/images" + empty_directory_with_gitkeep "app/assets/images/#{name}" end end @@ -108,9 +108,9 @@ task :default => :test def stylesheets if mountable? copy_file "#{app_templates_dir}/app/assets/stylesheets/application.css", - "app/assets/stylesheets/application.css" + "app/assets/stylesheets/#{name}/application.css" elsif full? - empty_directory_with_gitkeep "app/assets/stylesheets" + empty_directory_with_gitkeep "app/assets/stylesheets/#{name}" end end @@ -119,9 +119,9 @@ task :default => :test if mountable? template "#{app_templates_dir}/app/assets/javascripts/application.js.tt", - "app/assets/javascripts/application.js" + "app/assets/javascripts/#{name}/application.js" elsif full? - empty_directory_with_gitkeep "app/assets/javascripts" + empty_directory_with_gitkeep "app/assets/javascripts/#{name}" end end diff --git a/railties/lib/rails/generators/rails/plugin_new/templates/app/views/layouts/application.html.erb.tt b/railties/lib/rails/generators/rails/plugin_new/templates/app/views/layouts/application.html.erb.tt new file mode 100644 index 0000000000..01550dec2f --- /dev/null +++ b/railties/lib/rails/generators/rails/plugin_new/templates/app/views/layouts/application.html.erb.tt @@ -0,0 +1,14 @@ +<!DOCTYPE html> +<html> +<head> + <title><%= camelized %></title> + <%%= stylesheet_link_tag "<%= name %>/application" %> + <%%= javascript_include_tag "<%= name %>/application" %> + <%%= csrf_meta_tags %> +</head> +<body> + +<%%= yield %> + +</body> +</html> |