{
    "mode": "ri",
    "parameter": "ActionView::RecordIdentifier",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/ri/ActionView%3A%3ARecordIdentifier/json",
    "generated": "2026-07-31T05:55:47Z",
    "sections": {
        "ActionView::RecordIdentifier": {
            "content": "------------------------------------------------------------------------",
            "subsections": []
        },
        "Extended by:": {
            "content": "ModelNaming (from /home/chedong/.local/share/rdoc)\n\n(from /home/chedong/.local/share/rdoc)\n------------------------------------------------------------------------\nRecordIdentifier encapsulates methods used by various ActionView helpers\nto associate records with DOM elements.\n\nConsider for example the following code that form of post:\n\n<%= formfor(post) do |f| %>\n<%= f.textfield :body %>\n<% end %>\n\nWhen post is a new, unsaved ActiveRecord::Base instance, the resulting\nHTML is:\n\n<form class=\"newpost\" id=\"newpost\" action=\"/posts\" accept-charset=\"UTF-8\" method=\"post\">\n<input type=\"text\" name=\"post[body]\" id=\"postbody\" />\n</form>\n\nWhen post is a persisted ActiveRecord::Base instance, the resulting HTML\nis:\n\n<form class=\"editpost\" id=\"editpost42\" action=\"/posts/42\" accept-charset=\"UTF-8\" method=\"post\">\n<input type=\"text\" value=\"What a wonderful world!\" name=\"post[body]\" id=\"postbody\" />\n</form>\n\nIn both cases, the id and class of the wrapping DOM element are\nautomatically generated, following naming conventions encapsulated by\nthe RecordIdentifier methods #domid and #domclass:\n\ndomid(Post.new)         # => \"newpost\"\ndomclass(Post.new)      # => \"post\"\ndomid(Post.find 42)     # => \"post42\"\ndomclass(Post.find 42)  # => \"post\"\n\nNote that these methods do not strictly require Post to be a subclass of\nActiveRecord::Base. Any Post class will work as long as its instances\nrespond to tokey and modelname, given that modelname responds to\nparamkey. For instance:\n\nclass Post\nattraccessor :tokey\n\ndef modelname\nOpenStruct.new paramkey: 'post'\nend\n\ndef self.find(id)\nnew.tap { |post| post.tokey = [id] }\nend\nend\n------------------------------------------------------------------------",
            "subsections": []
        },
        "Constants:": {
            "content": "JOIN:\n[not documented]\n\nNEW:\n[not documented]\n\n",
            "subsections": []
        },
        "Instance methods:": {
            "content": "domclass\ndomid\nrecordkeyfordomid\n",
            "subsections": []
        }
    },
    "flags": [],
    "examples": [],
    "see_also": []
}