aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorJason <jasonmichaelroth@gmail.com>2011-05-08 08:58:48 -0600
committerJason <jasonmichaelroth@gmail.com>2011-05-08 08:58:48 -0600
commitc7d8661118b6d007b03c131fb8946e393c7f0891 (patch)
tree14e3c16b5a5368623fe19e15605ffa94761609eb /actionpack
parent197f3f07d6bd4fbd8e8a877e29fbad8aefba9c71 (diff)
downloadrails-c7d8661118b6d007b03c131fb8946e393c7f0891.tar.gz
rails-c7d8661118b6d007b03c131fb8946e393c7f0891.tar.bz2
rails-c7d8661118b6d007b03c131fb8946e393c7f0891.zip
Fixed documentation of select tag; options with html need to pass through html_safe
https://github.com/rails/rails/issues/447 https://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/6759-api-document-incorrect
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/lib/action_view/helpers/form_tag_helper.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/actionpack/lib/action_view/helpers/form_tag_helper.rb b/actionpack/lib/action_view/helpers/form_tag_helper.rb
index 9e0f8f32b7..65a98fb27a 100644
--- a/actionpack/lib/action_view/helpers/form_tag_helper.rb
+++ b/actionpack/lib/action_view/helpers/form_tag_helper.rb
@@ -82,22 +82,22 @@ module ActionView
# select_tag "people", options_from_collection_for_select(@people, "id", "name")
# # <select id="people" name="people"><option value="1">David</option></select>
#
- # select_tag "people", "<option>David</option>"
+ # select_tag "people", "<option>David</option>".html_safe
# # => <select id="people" name="people"><option>David</option></select>
#
- # select_tag "count", "<option>1</option><option>2</option><option>3</option><option>4</option>"
+ # select_tag "count", "<option>1</option><option>2</option><option>3</option><option>4</option>".html_safe
# # => <select id="count" name="count"><option>1</option><option>2</option>
# # <option>3</option><option>4</option></select>
#
- # select_tag "colors", "<option>Red</option><option>Green</option><option>Blue</option>", :multiple => true
+ # select_tag "colors", "<option>Red</option><option>Green</option><option>Blue</option>".html_safe, :multiple => true
# # => <select id="colors" multiple="multiple" name="colors[]"><option>Red</option>
# # <option>Green</option><option>Blue</option></select>
#
- # select_tag "locations", "<option>Home</option><option selected="selected">Work</option><option>Out</option>"
+ # select_tag "locations", "<option>Home</option><option selected="selected">Work</option><option>Out</option>".html_safe
# # => <select id="locations" name="locations"><option>Home</option><option selected='selected'>Work</option>
# # <option>Out</option></select>
#
- # select_tag "access", "<option>Read</option><option>Write</option>", :multiple => true, :class => 'form_input'
+ # select_tag "access", "<option>Read</option><option>Write</option>".html_safe, :multiple => true, :class => 'form_input'
# # => <select class="form_input" id="access" multiple="multiple" name="access[]"><option>Read</option>
# # <option>Write</option></select>
#
@@ -107,7 +107,7 @@ module ActionView
# select_tag "people", options_from_collection_for_select(@people, "id", "name"), :prompt => "Select something"
# # => <select id="people" name="people"><option value="">Select something</option><option value="1">David</option></select>
#
- # select_tag "destination", "<option>NYC</option><option>Paris</option><option>Rome</option>", :disabled => true
+ # select_tag "destination", "<option>NYC</option><option>Paris</option><option>Rome</option>".html_safe, :disabled => true
# # => <select disabled="disabled" id="destination" name="destination"><option>NYC</option>
# # <option>Paris</option><option>Rome</option></select>
def select_tag(name, option_tags = nil, options = {})