aboutsummaryrefslogtreecommitdiffstats
path: root/guides
diff options
context:
space:
mode:
Diffstat (limited to 'guides')
-rw-r--r--guides/code/getting_started/config/boot.rb2
-rw-r--r--guides/rails_guides.rb3
-rw-r--r--guides/source/action_view_overview.textile2
-rw-r--r--guides/source/active_model_basics.textile5
-rw-r--r--guides/source/ajax_on_rails.textile4
-rw-r--r--guides/source/form_helpers.textile2
-rw-r--r--guides/source/initialization.textile2
-rw-r--r--guides/w3c_validator.rb1
8 files changed, 6 insertions, 15 deletions
diff --git a/guides/code/getting_started/config/boot.rb b/guides/code/getting_started/config/boot.rb
index 4489e58688..3596736667 100644
--- a/guides/code/getting_started/config/boot.rb
+++ b/guides/code/getting_started/config/boot.rb
@@ -1,5 +1,3 @@
-require 'rubygems'
-
# Set up gems listed in the Gemfile.
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
diff --git a/guides/rails_guides.rb b/guides/rails_guides.rb
index e662ad2ed9..1955309865 100644
--- a/guides/rails_guides.rb
+++ b/guides/rails_guides.rb
@@ -8,9 +8,6 @@ def bundler?
File.exists?('Gemfile')
end
-# Loading Action Pack requires rack and erubis.
-require 'rubygems'
-
begin
# Guides generation in the Rails repo.
as_lib = File.join(pwd, "../activesupport/lib")
diff --git a/guides/source/action_view_overview.textile b/guides/source/action_view_overview.textile
index fd1b6c5fc2..bde30ba21c 100644
--- a/guides/source/action_view_overview.textile
+++ b/guides/source/action_view_overview.textile
@@ -59,7 +59,6 @@ Now we'll create a simple "Hello World" application that uses the +titleize+ met
*hello_world.rb:*
<ruby>
-require 'rubygems'
require 'active_support/core_ext/string/inflections'
require 'rack'
@@ -94,7 +93,6 @@ Now we'll create the same "Hello World" application in Sinatra.
*hello_world.rb:*
<ruby>
-require 'rubygems'
require 'action_view'
require 'sinatra'
diff --git a/guides/source/active_model_basics.textile b/guides/source/active_model_basics.textile
index 98b3533000..d373f4ac85 100644
--- a/guides/source/active_model_basics.textile
+++ b/guides/source/active_model_basics.textile
@@ -20,7 +20,7 @@ class Person
attribute_method_prefix 'reset_'
attribute_method_suffix '_highest?'
- define_attribute_methods ['age']
+ define_attribute_methods 'age'
attr_accessor :age
@@ -95,12 +95,11 @@ h4. Dirty
An object becomes dirty when an object is gone through one or more changes to its attributes and not yet saved. This gives the ability to check whether an object has been changed or not. It also has attribute based accessor methods. Lets consider a Person class with attributes first_name and last_name
<ruby>
-require 'rubygems'
require 'active_model'
class Person
include ActiveModel::Dirty
- define_attribute_methods [:first_name, :last_name]
+ define_attribute_methods :first_name, :last_name
def first_name
@first_name
diff --git a/guides/source/ajax_on_rails.textile b/guides/source/ajax_on_rails.textile
index cda9c64460..bfd007490a 100644
--- a/guides/source/ajax_on_rails.textile
+++ b/guides/source/ajax_on_rails.textile
@@ -78,7 +78,7 @@ will produce
<ruby>
button_to('Destroy', 'http://www.example.com', :confirm => 'Are you sure?',
- :method => "delete", :remote => true, :disable_with => 'loading...')
+ :method => "delete", :remote => true, 'data-disable-with' => 'loading...')
</ruby>
will produce
@@ -87,7 +87,7 @@ will produce
<form class='button_to' method='post' action='http://www.example.com' data-remote='true'>
<div>
<input name='_method' value='delete' type='hidden' />
- <input value='Destroy' type='submit' disable_with='loading...' data-confirm='Are you sure?' />
+ <input value='Destroy' type='submit' data-disable-with='loading...' data-confirm='Are you sure?' />
</div>
</form>
</html>
diff --git a/guides/source/form_helpers.textile b/guides/source/form_helpers.textile
index b6420db798..711ed3d859 100644
--- a/guides/source/form_helpers.textile
+++ b/guides/source/form_helpers.textile
@@ -405,6 +405,8 @@ Whenever Rails sees that the internal value of an option being generated matches
TIP: The second argument to +options_for_select+ must be exactly equal to the desired internal value. In particular if the value is the integer 2 you cannot pass "2" to +options_for_select+ -- you must pass 2. Be aware of values extracted from the +params+ hash as they are all strings.
+WARNING: when +:inlude_blank+ or +:prompt:+ are not present, +:include_blank+ is forced true if the select attribute +required+ is true, display +size+ is one and +multiple+ is not true.
+
h4. Select Boxes for Dealing with Models
In most cases form controls will be tied to a specific database model and as you might expect Rails provides helpers tailored for that purpose. Consistent with other form helpers, when dealing with models you drop the +_tag+ suffix from +select_tag+:
diff --git a/guides/source/initialization.textile b/guides/source/initialization.textile
index 69e5c1edcc..155a439e64 100644
--- a/guides/source/initialization.textile
+++ b/guides/source/initialization.textile
@@ -137,8 +137,6 @@ h4. +config/boot.rb+
+config/boot.rb+ contains this:
<ruby>
-require 'rubygems'
-
# Set up gems listed in the Gemfile.
gemfile = File.expand_path('../../Gemfile', __FILE__)
begin
diff --git a/guides/w3c_validator.rb b/guides/w3c_validator.rb
index 84f34f9293..5e340499c4 100644
--- a/guides/w3c_validator.rb
+++ b/guides/w3c_validator.rb
@@ -26,7 +26,6 @@
#
# ---------------------------------------------------------------------------
-require 'rubygems'
require 'w3c_validators'
include W3CValidators