Skip to content

simple ActiveRecord mixin, that generates some usefull methods for woking with ajax or css

License

Notifications You must be signed in to change notification settings

cheef/dom_names

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dom_names
======================
This plugin added three ActiveRecord::Base instance methods to simplify work with ajax or css.

USES:
======================
AR instance methods:
- dom_id
- dom_class
- dom_path

dom_id
=======================
@post = Post.find(1)
@post.dom_id                    => post_1
@post.dom_id("favorite")          => favorite_post_1
@post.dom_id("favorite", "deleted") => favorite_post_1_deleted

dom_path
=======================
@post.dom_path  => posts

dom_class
=======================
@post.dom_class            => post
@post.dom_class("new")       => new_post
@post.dom_class("cool", false) => cool_posts

=======================
author Ivan Garmatenko <cheef.che@gmail.com>

About

simple ActiveRecord mixin, that generates some usefull methods for woking with ajax or css

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages