diff options
author | claudiob <claudiob@gmail.com> | 2014-12-19 12:49:50 -0800 |
---|---|---|
committer | claudiob <claudiob@gmail.com> | 2014-12-23 02:01:53 +0100 |
commit | 943ebcb5f1459e5c2c9a75c08684c987939201f1 (patch) | |
tree | 90f8bd391d017c2e1321e79a64113309cbb80d41 /guides/source/working_with_javascript_in_rails.md | |
parent | 8259d795606e3f3333537baadf0d1a37c4fd4fd0 (diff) | |
download | rails-943ebcb5f1459e5c2c9a75c08684c987939201f1.tar.gz rails-943ebcb5f1459e5c2c9a75c08684c987939201f1.tar.bz2 rails-943ebcb5f1459e5c2c9a75c08684c987939201f1.zip |
Better docs for AV::RecordIdentifier
This commit intends to clarify the scope of ActionView::RecordIdentifier
methods `dom_id` and `dom_class`.
Most of the current documentation comes from da257eb8 (7 years ago) when
the decoupling of ActionView, ActiveRecord and ActiveModel was not a concern.
Since then, steps have been taken to reach such decoupling, especially
8ca17926 which duplicated ActionController::ModelNaming into
ActionView::ModelNaming explaining that:
> These are just a simple helpers for decoupling Active Model, so it does not
> make sense to extract it to Active Support, but the point is to decouple also
> Action View and Action Pack
As of today, ActionView::RecordIdentifier only includes `dom_id` and `dom_class`
so it makes sense to explicitly document those two methods, and leaving the
details of helpers like `div_for` in the corresponding files.
Moreover, I think it's important to mention in the documentation that
ActionView::RecordIdentifier **does not strictly depend on the ActiveRecord API**: any class `Post` implementing `post.to_key` and `post.model_name.param_key` will work.
[ci skip]
Diffstat (limited to 'guides/source/working_with_javascript_in_rails.md')
0 files changed, 0 insertions, 0 deletions