提交 0693bc2c 编写于 作者: A Alexey Vakhov

Add AC record identifier example with not-persisted object

上级 c91d07f5
......@@ -53,6 +53,7 @@ def dom_class(record_or_class, prefix = nil)
# 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}"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册