<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Splitting Rails DOM ids with RegEx Look Aheads</title>
	<atom:link href="http://www.christopherirish.com/2010/10/15/splitting-rails-dom-ids-with-regex-look-aheads/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.christopherirish.com/2010/10/15/splitting-rails-dom-ids-with-regex-look-aheads/</link>
	<description>Ruby, Rails, Javascript, all things web development related</description>
	<lastBuildDate>Thu, 28 Jul 2022 18:51:26 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
	<item>
		<title>By: Joshua Pinter</title>
		<link>http://www.christopherirish.com/2010/10/15/splitting-rails-dom-ids-with-regex-look-aheads/comment-page-1/#comment-1060</link>
		<dc:creator>Joshua Pinter</dc:creator>
		<pubDate>Thu, 28 Jul 2022 18:51:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.christopherirish.com/?p=530#comment-1060</guid>
		<description>Super handy! Here&#039;s a little snippet to take it further and convert it to ActiveRecord objects: 

```
    dom_ids = params[ :dom_ids ].split( &quot;,&quot; ) # &quot;facility_2035637462,diagram_184&quot; =&gt; [ &quot;facility_2035637462&quot;, &quot;diagram_184&quot; ]

    objects = dom_ids.collect do &#124;dom_id&#124;
      klass, id = dom_id.split( /_(?!.*_)/ ) # Parse out the class and the id from the dom_id String.
      klass.classify.constantize.find( id )
    end
```</description>
		<content:encoded><![CDATA[<p>Super handy! Here&#8217;s a little snippet to take it further and convert it to ActiveRecord objects: </p>
<p>&#8220;`<br />
    dom_ids = params[ :dom_ids ].split( &#8220;,&#8221; ) # &#8220;facility_2035637462,diagram_184&#8243; =&gt; [ "facility_2035637462", "diagram_184" ]</p>
<p>    objects = dom_ids.collect do |dom_id|<br />
      klass, id = dom_id.split( /_(?!.*_)/ ) # Parse out the class and the id from the dom_id String.<br />
      klass.classify.constantize.find( id )<br />
    end<br />
&#8220;`</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dom</title>
		<link>http://www.christopherirish.com/2010/10/15/splitting-rails-dom-ids-with-regex-look-aheads/comment-page-1/#comment-39</link>
		<dc:creator>Dom</dc:creator>
		<pubDate>Sun, 17 Oct 2010 02:13:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.christopherirish.com/?p=530#comment-39</guid>
		<description>Very handy - thanks!</description>
		<content:encoded><![CDATA[<p>Very handy &#8211; thanks!</p>
]]></content:encoded>
	</item>
</channel>
</rss>
