diff options
author | Joshua Peek <josh@joshpeek.com> | 2009-10-08 14:13:36 -0500 |
---|---|---|
committer | Joshua Peek <josh@joshpeek.com> | 2009-10-08 14:13:49 -0500 |
commit | 3b6bdfc1050a83c6339421257d60a6163bf3c687 (patch) | |
tree | 8092062ff62656f5b4df23932fcb735e6244cda5 /actionpack/lib/action_view | |
parent | 665c7ad29d5614b8f5535d317f1dd2803ddcaa7d (diff) | |
download | rails-3b6bdfc1050a83c6339421257d60a6163bf3c687.tar.gz rails-3b6bdfc1050a83c6339421257d60a6163bf3c687.tar.bz2 rails-3b6bdfc1050a83c6339421257d60a6163bf3c687.zip |
API change: content_tag_for outputs prefixed class name
Diffstat (limited to 'actionpack/lib/action_view')
-rw-r--r-- | actionpack/lib/action_view/helpers/record_tag_helper.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/actionpack/lib/action_view/helpers/record_tag_helper.rb b/actionpack/lib/action_view/helpers/record_tag_helper.rb index 0cdb70e217..31411dc08a 100644 --- a/actionpack/lib/action_view/helpers/record_tag_helper.rb +++ b/actionpack/lib/action_view/helpers/record_tag_helper.rb @@ -15,7 +15,7 @@ module ActionView def div_for(record, *args, &block) content_tag_for(:div, record, *args, &block) end - + # content_tag_for creates an HTML element with id and class parameters # that relate to the specified Active Record object. For example: # @@ -34,7 +34,7 @@ module ActionView # <% content_tag_for(:tr, @person, :foo) do %> ... # # produces: - # + # # <tr id="foo_person_123" class="person">... # # content_tag_for also accepts a hash of options, which will be converted to @@ -50,7 +50,7 @@ module ActionView def content_tag_for(tag_name, record, *args, &block) prefix = args.first.is_a?(Hash) ? nil : args.shift options = args.extract_options! - options.merge!({ :class => "#{dom_class(record)} #{options[:class]}".strip, :id => dom_id(record, prefix) }) + options.merge!({ :class => "#{dom_class(record, prefix)} #{options[:class]}".strip, :id => dom_id(record, prefix) }) content_tag(tag_name, options, &block) end end |