aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/record_identifier.rb
diff options
context:
space:
mode:
authorAlexey Vakhov <vakhov@gmail.com>2012-04-05 12:07:30 +0600
committerAlexey Vakhov <vakhov@gmail.com>2012-04-05 12:07:30 +0600
commit0693bc2c2a3a98f75d0ddc7c57b731d2f13130b7 (patch)
tree1c121cade5f1d13d5ee74b73ef234a53b5ae947c /actionpack/lib/action_controller/record_identifier.rb
parentc91d07f57c22fb926b312561bf391fe67a28924c (diff)
downloadrails-0693bc2c2a3a98f75d0ddc7c57b731d2f13130b7.tar.gz
rails-0693bc2c2a3a98f75d0ddc7c57b731d2f13130b7.tar.bz2
rails-0693bc2c2a3a98f75d0ddc7c57b731d2f13130b7.zip
Add AC record identifier example with not-persisted object
Diffstat (limited to 'actionpack/lib/action_controller/record_identifier.rb')
-rw-r--r--actionpack/lib/action_controller/record_identifier.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/actionpack/lib/action_controller/record_identifier.rb b/actionpack/lib/action_controller/record_identifier.rb
index 18dda978b3..5c40889f6b 100644
--- a/actionpack/lib/action_controller/record_identifier.rb
+++ b/actionpack/lib/action_controller/record_identifier.rb
@@ -53,6 +53,7 @@ module ActionController
# If you need to address multiple instances of the same class in the same view, you can prefix the dom_id:
#
# dom_id(Post.find(45), :edit) # => "edit_post_45"
+ # dom_id(Post.new, :custom) # => "custom_post"
def dom_id(record, prefix = nil)
if record_id = record_key_for_dom_id(record)
"#{dom_class(record, prefix)}#{JOIN}#{record_id}"