diff options
author | Vijay Dev <vijaydev.cse@gmail.com> | 2010-12-24 00:17:44 +0530 |
---|---|---|
committer | Vijay Dev <vijaydev.cse@gmail.com> | 2010-12-24 00:19:41 +0530 |
commit | 5683d6883b20e5ed88e26d07c841911b225a5841 (patch) | |
tree | c5bdfa437a3cebd5a42dea403b98dc454e2dd605 | |
parent | 2c8938fcba6670f2cb056ec91d631ae0e37ea006 (diff) | |
download | rails-5683d6883b20e5ed88e26d07c841911b225a5841.tar.gz rails-5683d6883b20e5ed88e26d07c841911b225a5841.tar.bz2 rails-5683d6883b20e5ed88e26d07c841911b225a5841.zip |
It's JavaScript :)
5 files changed, 17 insertions, 17 deletions
diff --git a/railties/guides/source/2_2_release_notes.textile b/railties/guides/source/2_2_release_notes.textile index 5628d7e52f..8e2d528eee 100644 --- a/railties/guides/source/2_2_release_notes.textile +++ b/railties/guides/source/2_2_release_notes.textile @@ -260,15 +260,15 @@ h4. Other Action Controller Changes * Benchmarking numbers are now reported in milliseconds rather than tiny fractions of seconds * Rails now supports HTTP-only cookies (and uses them for sessions), which help mitigate some cross-site scripting risks in newer browsers. * +redirect_to+ now fully supports URI schemes (so, for example, you can redirect to a svn+ssh: URI). -* +render+ now supports a +:js+ option to render plain vanilla javascript with the right mime type. +* +render+ now supports a +:js+ option to render plain vanilla JavaScript with the right mime type. * Request forgery protection has been tightened up to apply to HTML-formatted content requests only. * Polymorphic URLs behave more sensibly if a passed parameter is nil. For example, calling +polymorphic_path([@project, @date, @area])+ with a nil date will give you +project_area_path+. h3. Action View * +javascript_include_tag+ and +stylesheet_link_tag+ support a new +:recursive+ option to be used along with +:all+, so that you can load an entire tree of files with a single line of code. -* The included Prototype javascript library has been upgraded to version 1.6.0.3. -* +RJS#page.reload+ to reload the browser's current location via javascript +* The included Prototype JavaScript library has been upgraded to version 1.6.0.3. +* +RJS#page.reload+ to reload the browser's current location via JavaScript * The +atom_feed+ helper now takes an +:instruct+ option to let you insert XML processing instructions. h3. Action Mailer diff --git a/railties/guides/source/2_3_release_notes.textile b/railties/guides/source/2_3_release_notes.textile index 72fe723687..67743a4797 100644 --- a/railties/guides/source/2_3_release_notes.textile +++ b/railties/guides/source/2_3_release_notes.textile @@ -278,7 +278,7 @@ Mime::JS =~ "text/javascript" => true Mime::JS =~ "application/javascript" => true </ruby> -The other change is that the framework now uses the +Mime::JS+ when checking for javascript in various spots, making it handle those alternatives cleanly. +The other change is that the framework now uses the +Mime::JS+ when checking for JavaScript in various spots, making it handle those alternatives cleanly. * Lead Contributor: "Seth Fitzsimmons":http://www.workingwithrails.com/person/5510-seth-fitzsimmons diff --git a/railties/guides/source/action_view_overview.textile b/railties/guides/source/action_view_overview.textile index 051baa660c..30faeeaa91 100644 --- a/railties/guides/source/action_view_overview.textile +++ b/railties/guides/source/action_view_overview.textile @@ -231,7 +231,7 @@ input("post", "title") # => h4. AssetTagHelper -This module provides methods for generating HTML that links views to assets such as images, javascripts, stylesheets, and feeds. +This module provides methods for generating HTML that links views to assets such as images, JavaScript files, stylesheets, and feeds. By default, Rails links to these assets on the current host in the public folder, but you can direct Rails to link to assets from a dedicated assets server by setting +ActionController::Base.asset_host+ in the application configuration, typically in +config/environments/production.rb+. For example, let's say your asset host is +assets.example.com+: @@ -242,7 +242,7 @@ image_tag("rails.png") # => <img src="http://assets.example.com/images/rails.png h5. register_javascript_expansion -Register one or more javascript files to be included when symbol is passed to javascript_include_tag. This method is typically intended to be called from plugin initialization to register javascript files that the plugin installed in public/javascripts. +Register one or more JavaScript files to be included when symbol is passed to javascript_include_tag. This method is typically intended to be called from plugin initialization to register JavaScript files that the plugin installed in +public/javascripts+. <ruby> ActionView::Helpers::AssetTagHelper.register_javascript_expansion :monkey => ["head", "body", "tail"] @@ -278,7 +278,7 @@ auto_discovery_link_tag(:rss, "http://www.example.com/feed.rss", {:title => "RSS h5. image_path -Computes the path to an image asset in the public images directory. Full paths from the document root will be passed through. Used internally by +image_tag+ to build the image path. +Computes the path to an image asset in the +public/images+ directory. Full paths from the document root will be passed through. Used internally by +image_tag+ to build the image path. <ruby> image_path("edit.png") # => /images/edit.png @@ -286,7 +286,7 @@ image_path("edit.png") # => /images/edit.png h5. image_tag -Returns an html image tag for the source. The source can be a full path or a file that exists in your public images directory. +Returns an html image tag for the source. The source can be a full path or a file that exists in your +public/images+ directory. <ruby> image_tag("icon.png") # => <img src="/images/icon.png" alt="Icon" /> @@ -294,26 +294,26 @@ image_tag("icon.png") # => <img src="/images/icon.png" alt="Icon" /> h5. javascript_include_tag -Returns an html script tag for each of the sources provided. You can pass in the filename (+.js+ extension is optional) of javascript files that exist in your +public/javascripts+ directory for inclusion into the current page or you can pass the full path relative to your document root. +Returns an html script tag for each of the sources provided. You can pass in the filename (+.js+ extension is optional) of JavaScript files that exist in your +public/javascripts+ directory for inclusion into the current page or you can pass the full path relative to your document root. <ruby> javascript_include_tag "common" # => <script type="text/javascript" src="/javascripts/common.js"></script> </ruby> -To include the Prototype and Scriptaculous javascript libraries in your application, pass +:defaults+ as the source. When using +:defaults+, if an +application.js+ file exists in your +public/javascripts+ directory, it will be included as well. +To include the Prototype and Scriptaculous JavaScript libraries in your application, pass +:defaults+ as the source. When using +:defaults+, if an +application.js+ file exists in your +public/javascripts+ directory, it will be included as well. <ruby> javascript_include_tag :defaults </ruby> -You can also include all javascripts in the javascripts directory using +:all+ as the source. +You can also include all JavaScript files in the +public/javascripts+ directory using +:all+ as the source. <ruby> javascript_include_tag :all </ruby> -You can also cache multiple javascripts into one file, which requires less HTTP connections to download and can better be compressed by gzip (leading to faster transfers). Caching will only happen if +ActionController::Base.perform_caching+ is set to true (which is the case by default for the Rails production environment, but not for the development environment). +You can also cache multiple JavaScript files into one file, which requires less HTTP connections to download and can better be compressed by gzip (leading to faster transfers). Caching will only happen if +ActionController::Base.perform_caching+ is set to true (which is the case by default for the Rails production environment, but not for the development environment). <ruby> javascript_include_tag :all, :cache => true # => @@ -322,7 +322,7 @@ javascript_include_tag :all, :cache => true # => h5. javascript_path -Computes the path to a javascript asset in the +public/javascripts+ directory. If the source filename has no extension, +.js+ will be appended. Full paths from the document root will be passed through. Used internally by +javascript_include_tag+ to build the script path. +Computes the path to a JavaScript asset in the +public/javascripts+ directory. If the source filename has no extension, +.js+ will be appended. Full paths from the document root will be passed through. Used internally by +javascript_include_tag+ to build the script path. <ruby> javascript_path "common" # => /javascripts/common.js @@ -352,7 +352,7 @@ stylesheet_link_tag :all, :cache => true h5. stylesheet_path -Computes the path to a stylesheet asset in the public stylesheets directory. If the source filename has no extension, .css will be appended. Full paths from the document root will be passed through. Used internally by stylesheet_link_tag to build the stylesheet path. +Computes the path to a stylesheet asset in the +public/stylesheets+ directory. If the source filename has no extension, .css will be appended. Full paths from the document root will be passed through. Used internally by stylesheet_link_tag to build the stylesheet path. <ruby> stylesheet_path "application" # => /stylesheets/application.css @@ -1076,7 +1076,7 @@ h4. JavaScriptHelper Provides functionality for working with JavaScript in your views. -Rails includes the Prototype JavaScript framework and the Scriptaculous JavaScript controls and visual effects library. If you wish to use these libraries and their helpers, make sure +<%= javascript_include_tag :defaults, :cache => true %>+ is in the HEAD section of your page. This function will include the necessary JavaScript files Rails generated in the public/javascripts directory. +Rails includes the Prototype JavaScript framework and the Scriptaculous JavaScript controls and visual effects library. If you wish to use these libraries and their helpers, make sure +<%= javascript_include_tag :defaults, :cache => true %>+ is in the HEAD section of your page. This function will include the necessary JavaScript files Rails generated in the +public/javascripts+ directory. h5. button_to_function diff --git a/railties/guides/source/getting_started.textile b/railties/guides/source/getting_started.textile index e371632d87..ef93239b30 100644 --- a/railties/guides/source/getting_started.textile +++ b/railties/guides/source/getting_started.textile @@ -184,7 +184,7 @@ In any case, Rails will create a folder in your working directory called <tt>blo |doc/|In-depth documentation for your application.| |lib/|Extended modules for your application (not covered in this guide).| |log/|Application log files.| -|public/|The only folder seen to the world as-is. This is where your images, javascript, stylesheets (CSS), and other static files go.| +|public/|The only folder seen to the world as-is. This is where your images, JavaScript files, stylesheets (CSS), and other static files go.| |script/|Contains the rails script that starts your app and can contain other scripts you use to deploy or run your application.| |test/|Unit tests, fixtures, and other test apparatus. These are covered in "Testing Rails Applications":testing.html| |tmp/|Temporary files| diff --git a/railties/guides/source/layouts_and_rendering.textile b/railties/guides/source/layouts_and_rendering.textile index 4cdd4f2709..f0e40b0980 100644 --- a/railties/guides/source/layouts_and_rendering.textile +++ b/railties/guides/source/layouts_and_rendering.textile @@ -681,7 +681,7 @@ There are three tag options available for +auto_discovery_link_tag+: * +:type+ specifies an explicit MIME type. Rails will generate an appropriate MIME type automatically. * +:title+ specifies the title of the link -h5. Linking to Javascript Files with +javascript_include_tag+ +h5. Linking to JavaScript Files with +javascript_include_tag+ The +javascript_include_tag+ helper returns an HTML +script+ tag for each source provided. Rails looks in +public/javascripts+ for these files by default, but you can specify a full path relative to the document root, or a URL, if you prefer. For example, to include +public/javascripts/main.js+: |