<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Sean&#039;s Blog &#187; nested</title>
	<atom:link href="http://seanbehan.com/tag/nested/feed/" rel="self" type="application/rss+xml" />
	<link>http://seanbehan.com</link>
	<description>Web Programming, Ruby on Rails, Wordpress, PHP from Burlington, Vermont</description>
	<lastBuildDate>Wed, 08 Sep 2010 16:10:05 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Accessing Links in Nested TD Cells with Prototype</title>
		<link>http://seanbehan.com/javascript/accessing-links-in-nested-td-cells-with-prototype/</link>
		<comments>http://seanbehan.com/javascript/accessing-links-in-nested-td-cells-with-prototype/#comments</comments>
		<pubDate>Tue, 17 Nov 2009 21:59:42 +0000</pubDate>
		<dc:creator>bseanvt</dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[$$]]></category>
		<category><![CDATA[code optimization]]></category>
		<category><![CDATA[nested]]></category>
		<category><![CDATA[prototype]]></category>
		<category><![CDATA[tables]]></category>
		<category><![CDATA[td]]></category>

		<guid isPermaLink="false">http://seanbehan.com/?p=618</guid>
		<description><![CDATA[There must be a better way to do the following with PrototypeJS. I want to loop over nested links inside of table td cells and apply a class to the row that the link is in when the link is clicked. If a user clicks on another link the class will be removed and applied [...]]]></description>
			<content:encoded><![CDATA[<p>There must be a better way to do the following with PrototypeJS. I want to loop over nested links inside of  table td cells and apply a class to the row that the link is in when the link is clicked. If a user clicks on another link the class will be removed and applied to the current table row.</p>
<p>The code below works but I think it seems hackish. Any thoughts on improving this code?</p>
<p>Here is the link to the pastie <a href="http://pastie.org/703316">http://pastie.org/703316</a></p>
<pre>
# This is the table with haml markup
%table
  %tr
    %td
       info
    %td
      = link_to "be clicked", remote_request_goes_here_path
</pre>
<p>And the Js</p>
<pre>
	$$("td.filter_link > a").each(function(element){
		Event.observe(element, "click", function(event){
			$$("td.filter_link").each(function(el){
				if(el != this){
					el.up().removeClassName("turnwhite");
				}
			});
                       // apply the turnwhite class to the table row
			this.up().up().addClassName("turnwhite");
		});
	});
</pre>
]]></content:encoded>
			<wfw:commentRss>http://seanbehan.com/javascript/accessing-links-in-nested-td-cells-with-prototype/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Nested Attributes in a Form for Has_One Model Association in Rails</title>
		<link>http://seanbehan.com/ruby-on-rails/nested-attributes-in-a-form-for-has_one-model-association-in-rails/</link>
		<comments>http://seanbehan.com/ruby-on-rails/nested-attributes-in-a-form-for-has_one-model-association-in-rails/#comments</comments>
		<pubDate>Thu, 23 Jul 2009 17:13:50 +0000</pubDate>
		<dc:creator>bseanvt</dc:creator>
				<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[forms]]></category>
		<category><![CDATA[has_one]]></category>
		<category><![CDATA[nested]]></category>

		<guid isPermaLink="false">http://seanbehan.com/?p=449</guid>
		<description><![CDATA[Just for reference&#8230; class Member < ActiveRecord::Base has_one :member_profile accepts_nested_attributes_for :member_profile end]]></description>
			<content:encoded><![CDATA[<p>Just for reference&#8230;</p>
<pre>
class Member < ActiveRecord::Base
    has_one :member_profile
    accepts_nested_attributes_for :member_profile
end
</pre>
<pre>


<% form_for @member do |f| -%>
       <%= f.label :fullname %> <%= f.text_field :fullname %>
	<% f.fields_for :member_profile, @member.member_profile do |member_profile|%>

<%= member_profile.label :about %><%= member_profile.text_field :about %>

<%= member_profile.label :favorite_color %><%= member_profile.text_field :favorite_color %>

	<% end %>

</pre>
]]></content:encoded>
			<wfw:commentRss>http://seanbehan.com/ruby-on-rails/nested-attributes-in-a-form-for-has_one-model-association-in-rails/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
