From 255d9c3d6bdee9d1d1692e4044f1e7f34ae230e7 Mon Sep 17 00:00:00 2001 From: Amro Mousa Date: Sun, 5 Feb 2012 09:54:32 -0500 Subject: Update fixtures testing help --- railties/guides/source/testing.textile | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) (limited to 'railties') diff --git a/railties/guides/source/testing.textile b/railties/guides/source/testing.textile index e0386b95b4..1e6b92f45c 100644 --- a/railties/guides/source/testing.textile +++ b/railties/guides/source/testing.textile @@ -114,25 +114,18 @@ Rails by default automatically loads all fixtures from the +test/fixtures+ folde * Load the fixture data into the table * Dump the fixture data into a variable in case you want to access it directly -h5. Hashes with Special Powers +h5. Fixtures are ActiveRecord objects -Fixtures are basically Hash objects. As mentioned in point #3 above, you can access the hash object directly because it is automatically setup as a local variable of the test case. For example: +Fixtures are instances of ActiveRecord. As mentioned in point #3 above, you can access the object directly because it is automatically setup as a local variable of the test case. For example: -# this will return the Hash for the fixture named david +# this will return the User object for the fixture named david users(:david) # this will return the property for david called id users(:david).id - - -Fixtures can also transform themselves into the form of the original class. Thus, you can get at the methods only available to that class. - - -# using the find method, we grab the "real" david as a User -david = users(:david).find -# and now we have access to methods only available to a User class +# one can also access methods available on the User class email(david.girlfriend.email, david.location_tonight) -- cgit v1.2.3 From 7f8f05f6275bae436fa801d2988498940ad641a7 Mon Sep 17 00:00:00 2001 From: Tom Stuart Date: Sun, 5 Feb 2012 15:16:03 +0000 Subject: Stop referring to Atom as "ATOM" $ curl -s http://www.ietf.org/rfc/rfc4287 | grep -io ATOM | sort | uniq -c 582 atom 175 Atom --- railties/guides/source/action_view_overview.textile | 4 ++-- railties/guides/source/layouts_and_rendering.textile | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'railties') diff --git a/railties/guides/source/action_view_overview.textile b/railties/guides/source/action_view_overview.textile index e2b69fa0d5..bb1b3b5fd8 100644 --- a/railties/guides/source/action_view_overview.textile +++ b/railties/guides/source/action_view_overview.textile @@ -570,7 +570,7 @@ stylesheet_link_tag :monkey # => h5. auto_discovery_link_tag -Returns a link tag that browsers and news readers can use to auto-detect an RSS or ATOM feed. +Returns a link tag that browsers and news readers can use to auto-detect an RSS or Atom feed. auto_discovery_link_tag(:rss, "http://www.example.com/feed.rss", {:title => "RSS Feed"}) # => @@ -663,7 +663,7 @@ h4. AtomFeedHelper h5. atom_feed -This helper makes building an ATOM feed easy. Here's a full usage example: +This helper makes building an Atom feed easy. Here's a full usage example: *config/routes.rb* diff --git a/railties/guides/source/layouts_and_rendering.textile b/railties/guides/source/layouts_and_rendering.textile index 5cff2d0893..c3df9d203f 100644 --- a/railties/guides/source/layouts_and_rendering.textile +++ b/railties/guides/source/layouts_and_rendering.textile @@ -656,7 +656,7 @@ WARNING: The asset tag helpers do _not_ verify the existence of the assets at th h5. Linking to Feeds with the +auto_discovery_link_tag+ -The +auto_discovery_link_tag+ helper builds HTML that most browsers and newsreaders can use to detect the presences of RSS or ATOM feeds. It takes the type of the link (+:rss+ or +:atom+), a hash of options that are passed through to url_for, and a hash of options for the tag: +The +auto_discovery_link_tag+ helper builds HTML that most browsers and newsreaders can use to detect the presences of RSS or Atom feeds. It takes the type of the link (+:rss+ or +:atom+), a hash of options that are passed through to url_for, and a hash of options for the tag: <%= auto_discovery_link_tag(:rss, {:action => "feed"}, -- cgit v1.2.3 From 061fd22783ae3522de5746d9f9c6b5ceab145c12 Mon Sep 17 00:00:00 2001 From: Ben Orenstein Date: Wed, 8 Feb 2012 20:12:01 -0500 Subject: Fix typo. --- railties/guides/source/layouts_and_rendering.textile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'railties') diff --git a/railties/guides/source/layouts_and_rendering.textile b/railties/guides/source/layouts_and_rendering.textile index c3df9d203f..9b64300e4a 100644 --- a/railties/guides/source/layouts_and_rendering.textile +++ b/railties/guides/source/layouts_and_rendering.textile @@ -656,7 +656,7 @@ WARNING: The asset tag helpers do _not_ verify the existence of the assets at th h5. Linking to Feeds with the +auto_discovery_link_tag+ -The +auto_discovery_link_tag+ helper builds HTML that most browsers and newsreaders can use to detect the presences of RSS or Atom feeds. It takes the type of the link (+:rss+ or +:atom+), a hash of options that are passed through to url_for, and a hash of options for the tag: +The +auto_discovery_link_tag+ helper builds HTML that most browsers and newsreaders can use to detect the presence of RSS or Atom feeds. It takes the type of the link (+:rss+ or +:atom+), a hash of options that are passed through to url_for, and a hash of options for the tag: <%= auto_discovery_link_tag(:rss, {:action => "feed"}, -- cgit v1.2.3 From b0a39d9feb412777e4f3a0199f07713ef4e343c9 Mon Sep 17 00:00:00 2001 From: Ben Orenstein Date: Wed, 8 Feb 2012 20:37:23 -0500 Subject: Clean up some wording. --- railties/guides/source/layouts_and_rendering.textile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'railties') diff --git a/railties/guides/source/layouts_and_rendering.textile b/railties/guides/source/layouts_and_rendering.textile index 9b64300e4a..6ac9645917 100644 --- a/railties/guides/source/layouts_and_rendering.textile +++ b/railties/guides/source/layouts_and_rendering.textile @@ -667,7 +667,7 @@ There are three tag options available for the +auto_discovery_link_tag+: * +:rel+ specifies the +rel+ value in the link. The default value is "alternate". * +:type+ specifies an explicit MIME type. Rails will generate an appropriate MIME type automatically. -* +:title+ specifies the title of the link. The default value is the upshifted +:type+ value, for example, "ATOM" or "RSS". +* +:title+ specifies the title of the link. The default value is the uppercased +:type+ value, for example, "ATOM" or "RSS". h5. Linking to JavaScript Files with the +javascript_include_tag+ @@ -724,7 +724,7 @@ Outputting +script+ tags such as this: These two files for jQuery, +jquery.js+ and +jquery_ujs.js+ must be placed inside +public/javascripts+ if the application doesn't use the asset pipeline. These files can be downloaded from the "jquery-rails repository on GitHub":https://github.com/indirect/jquery-rails/tree/master/vendor/assets/javascripts -WARNING: If you are using the asset pipeline, this tag will render a +script+ tag for an asset called +defaults.js+, which would not exist in your application unless you've explicitly defined it to be. +WARNING: If you are using the asset pipeline, this tag will render a +script+ tag for an asset called +defaults.js+, which would not exist in your application unless you've explicitly created it. And you can in any case override the +:defaults+ expansion in config/application.rb: -- cgit v1.2.3