Rails Plugin: dynamically_tags
Rails Plugin: dynamically_tags: I wanted a way to allow a user to enter text into a field, and have that text automatically reference existing objects based on its content. For example, a user types a comment into a blog: “I think Chicago is a great city.” Somewhere in the database, there’s a City object with a :name field that contains “Chicago”. I want my application to realize this, and then DO something with that information. Most importantly, I want that linkage to persist, even if changes are made to the City object. And, finally, I don’t want my application to have to scrape through ever bit of rendered text and compare it to every existing object each time that someone requests that information.
I wrote a plug-in that allows you to do things like: dynamically_tags [:content], :includes => {:cities => :name} – Check the blog-post (contains a how-to and git-link).
Post a comment