Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added public/javascripts/application.js as a sample since it'll autom…

…atically be included in javascript_include_tag :defaults [DHH] (backed out of -a/--with-assets, not worth it)

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3770 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
commit 045f5fd02e8418fedba651b329715a0bb5ea8c68 1 parent 55854c4
@dhh dhh authored
View
2  railties/CHANGELOG
@@ -1,6 +1,6 @@
*SVN*
-* Added -a/--with-assets option to rails generator that will include default assets for application layout, javascript, and stylesheet (this an experiment and may go away at any time!) [DHH]
+* Added public/javascripts/application.js as a sample since it'll automatically be included in javascript_include_tag :defaults [DHH]
* Added socket cleanup for lighttpd, both before and after [DHH]
View
2  railties/Rakefile
@@ -39,7 +39,7 @@ TEST_DIRS = %w( fixtures unit functional mocks mocks/development mocks/test )
LOG_FILES = %w( server.log development.log test.log production.log )
HTML_FILES = %w( 404.html 500.html index.html robots.txt favicon.ico images/rails.png
- javascripts/prototype.js
+ javascripts/prototype.js javascripts/application.js
javascripts/effects.js javascripts/dragdrop.js javascripts/controls.js )
BIN_FILES = %w( about breakpointer console destroy generate performance/benchmarker performance/profiler process/reaper process/spawner runner server plugin )
View
1  railties/assets/application.css
@@ -1 +0,0 @@
-/* Place your application-specific styles here */
View
1  railties/assets/application.js
@@ -1 +0,0 @@
-// Place your application-specific JavaScript functions and classes here
View
15 railties/assets/application.rhtml
@@ -1,15 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
- <head>
- <meta http-equiv="content-type" content="text/html; charset=utf-8" />
- <title><%=h @title || "Rails Application" %></title>
- <%= javascript_include_tag :defaults %>
- <%= stylesheet_link_tag "application" %>
- </head>
-
- <body>
- <%= yield %>
- </body>
-</html>
View
2  railties/html/javascripts/application.js
@@ -0,0 +1,2 @@
+// Place your application-specific JavaScript functions and classes here
+// This file is automatically included by javascript_include_tag :defaults
View
21 railties/lib/rails_generator/generators/applications/app/app_generator.rb
@@ -6,7 +6,7 @@ class AppGenerator < Rails::Generator::Base
DATABASES = %w( mysql oracle postgresql sqlite2 sqlite3 )
- default_options :db => "mysql", :shebang => DEFAULT_SHEBANG, :include_assets => false
+ default_options :db => "mysql", :shebang => DEFAULT_SHEBANG
mandatory_options :source => "#{File.dirname(__FILE__)}/../../../../.."
def initialize(runtime_args, runtime_options = {})
@@ -69,10 +69,11 @@ def manifest
m.file "html/images/rails.png", "public/images/rails.png"
# Javascripts
- m.file "html/javascripts/prototype.js", "public/javascripts/prototype.js"
- m.file "html/javascripts/effects.js", "public/javascripts/effects.js"
- m.file "html/javascripts/dragdrop.js", "public/javascripts/dragdrop.js"
- m.file "html/javascripts/controls.js", "public/javascripts/controls.js"
+ m.file "html/javascripts/prototype.js", "public/javascripts/prototype.js"
+ m.file "html/javascripts/effects.js", "public/javascripts/effects.js"
+ m.file "html/javascripts/dragdrop.js", "public/javascripts/dragdrop.js"
+ m.file "html/javascripts/controls.js", "public/javascripts/controls.js"
+ m.file "html/javascripts/application.js", "public/javascripts/application.js"
# Docs
m.file "doc/README_FOR_APP", "doc/README_FOR_APP"
@@ -81,13 +82,6 @@ def manifest
%w(server production development test).each { |file|
m.file "configs/empty.log", "log/#{file}.log", :chmod => 0666
}
-
- # Default assets
- if options[:include_assets]
- m.file "assets/application.css", "public/stylesheets/application.css"
- m.file "assets/application.js", "public/javascripts/application.css"
- m.file "assets/application.rhtml", "app/views/layouts/application.rhtml"
- end
end
end
@@ -106,9 +100,6 @@ def add_options!(opt)
opt.on("-d", "--database=name", String,
"Preconfigure for selected database (options: mysql/oracle/postgresql/sqlite2/sqlite3).",
"Default: mysql") { |options[:db]| }
-
- opt.on("-a", "--with-assets",
- "Include default assets for layout, javascript, and stylesheet.") { |options[:include_assets]| }
end
def mysql_socket_location
Please sign in to comment.
Something went wrong with that request. Please try again.