<?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: Rails Relationships</title>
	<atom:link href="http://jonathanng.com/ruby-on-rails/rails-relationships/feed/" rel="self" type="application/rss+xml" />
	<link>http://jonathanng.com/ruby-on-rails/rails-relationships/</link>
	<description>class AllYourCode &#60; Us</description>
	<lastBuildDate>Mon, 28 Jun 2010 23:07:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<item>
		<title>By: Gil Wright</title>
		<link>http://jonathanng.com/ruby-on-rails/rails-relationships/comment-page-2/#comment-790</link>
		<dc:creator>Gil Wright</dc:creator>
		<pubDate>Wed, 06 May 2009 09:54:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.jonathansng.com/?p=147#comment-790</guid>
		<description>I am hoping that I have not done something silly....&lt;br&gt;&lt;br&gt;Following the instructions to the letter, everything worked until I started fooling around with the html.erb files.&lt;br&gt;&lt;br&gt;When I look in the database, I can see the author_id field in the books table (it is empty for all records). When I restart the server, the changes made in the erb files do not appear.&lt;br&gt;&lt;br&gt;My original erb files looked like (just one part):&lt;br&gt;  &lt;p&gt;&lt;br&gt;    &lt;%= f.label :description %&gt;&lt;br /&gt;&lt;br&gt;    &lt;%= f.text_area :description %&gt;&lt;br&gt;  &lt;/p&gt;&lt;br&gt;&lt;br&gt;I added a new section that looked like:&lt;br&gt;  &lt;p&gt;&lt;br&gt;    &lt;%= f.label :author %&gt;&lt;br /&gt;&lt;br&gt;      &lt;%= collection_select(:book, :author_id,  Author.find(:all, :order =&gt; &quot;name&quot;) , :id, :name) %&gt;&lt;br&gt;  &lt;/p&gt;&lt;br&gt;&lt;br&gt;Nothing happened = I still see the old form (with two entry boxes, no author pick list). Flushed cache, restarted browser, restarted server. Nothing changes.&lt;br&gt;&lt;br&gt;I changed the entire file to match the one in the tutorial. Still nothing changes.&lt;br&gt;&lt;br&gt;Going out on a limb I tried changing the page title to:&lt;br&gt;&lt;h1&gt;New Improved Book Entry Page&lt;/h1&gt;&lt;br&gt;&lt;br&gt;Still nothing. Any hints apart from suggesting a brick wall to bang my head against?&lt;br&gt;&lt;br&gt;Thanks.</description>
		<content:encoded><![CDATA[<p>I am hoping that I have not done something silly&#8230;.</p>
<p>Following the instructions to the letter, everything worked until I started fooling around with the html.erb files.</p>
<p>When I look in the database, I can see the author_id field in the books table (it is empty for all records). When I restart the server, the changes made in the erb files do not appear.</p>
<p>My original erb files looked like (just one part):<br /> 
<p>    &lt;%= f.label :description %&gt;</p>
<p>    &lt;%= f.text_area :description %&gt;  </p>
<p>I added a new section that looked like:<br /> 
<p>    &lt;%= f.label :author %&gt;</p>
<p>      &lt;%= collection_select(:book, :author_id,  Author.find(:all, <img src='http://jonathanng.com/wp-includes/images/smilies/icon_surprised.gif' alt=':o' class='wp-smiley' /> rder =&gt; &#8220;name&#8221;) , :id, :name) %&gt;  </p>
<p>Nothing happened = I still see the old form (with two entry boxes, no author pick list). Flushed cache, restarted browser, restarted server. Nothing changes.</p>
<p>I changed the entire file to match the one in the tutorial. Still nothing changes.</p>
<p>Going out on a limb I tried changing the page title to:<br />
<h1>New Improved Book Entry Page</h1>
<p>Still nothing. Any hints apart from suggesting a brick wall to bang my head against?</p>
<p>Thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gil Wright</title>
		<link>http://jonathanng.com/ruby-on-rails/rails-relationships/comment-page-2/#comment-734</link>
		<dc:creator>Gil Wright</dc:creator>
		<pubDate>Wed, 06 May 2009 02:54:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.jonathansng.com/?p=147#comment-734</guid>
		<description>I am hoping that I have not done something silly....&lt;br&gt;&lt;br&gt;Following the instructions to the letter, everything worked until I started fooling around with the html.erb files.&lt;br&gt;&lt;br&gt;When I look in the database, I can see the author_id field in the books table (it is empty for all records). When I restart the server, the changes made in the erb files do not appear.&lt;br&gt;&lt;br&gt;My original erb files looked like (just one part):&lt;br&gt;  &lt;p&gt;&lt;br&gt;    &lt;%= f.label :description %&gt;&lt;br /&gt;&lt;br&gt;    &lt;%= f.text_area :description %&gt;&lt;br&gt;  &lt;/p&gt;&lt;br&gt;&lt;br&gt;I added a new section that looked like:&lt;br&gt;  &lt;p&gt;&lt;br&gt;    &lt;%= f.label :author %&gt;&lt;br /&gt;&lt;br&gt;      &lt;%= collection_select(:book, :author_id,  Author.find(:all, :order =&gt; &quot;name&quot;) , :id, :name) %&gt;&lt;br&gt;  &lt;/p&gt;&lt;br&gt;&lt;br&gt;Nothing happened = I still see the old form (with two entry boxes, no author pick list). Flushed cache, restarted browser, restarted server. Nothing changes.&lt;br&gt;&lt;br&gt;I changed the entire file to match the one in the tutorial. Still nothing changes.&lt;br&gt;&lt;br&gt;Going out on a limb I tried changing the page title to:&lt;br&gt;&lt;h1&gt;New Improved Book Entry Page&lt;/h1&gt;&lt;br&gt;&lt;br&gt;Still nothing. Any hints apart from suggesting a brick wall to bang my head against?&lt;br&gt;&lt;br&gt;Thanks.</description>
		<content:encoded><![CDATA[<p>I am hoping that I have not done something silly&#8230;.</p>
<p>Following the instructions to the letter, everything worked until I started fooling around with the html.erb files.</p>
<p>When I look in the database, I can see the author_id field in the books table (it is empty for all records). When I restart the server, the changes made in the erb files do not appear.</p>
<p>My original erb files looked like (just one part):<br /> 
<p>    &lt;%= f.label :description %&gt;</p>
<p>    &lt;%= f.text_area :description %&gt;  </p>
<p>I added a new section that looked like:<br /> 
<p>    &lt;%= f.label :author %&gt;</p>
<p>      &lt;%= collection_select(:book, :author_id,  Author.find(:all, <img src='http://jonathanng.com/wp-includes/images/smilies/icon_surprised.gif' alt=':o' class='wp-smiley' /> rder =&gt; &#8220;name&#8221;) , :id, :name) %&gt;  </p>
<p>Nothing happened = I still see the old form (with two entry boxes, no author pick list). Flushed cache, restarted browser, restarted server. Nothing changes.</p>
<p>I changed the entire file to match the one in the tutorial. Still nothing changes.</p>
<p>Going out on a limb I tried changing the page title to:<br />&lt;h1&gt;New Improved Book Entry Page&lt;/h1&gt;</p>
<p>Still nothing. Any hints apart from suggesting a brick wall to bang my head against?</p>
<p>Thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Yas</title>
		<link>http://jonathanng.com/ruby-on-rails/rails-relationships/comment-page-2/#comment-719</link>
		<dc:creator>Yas</dc:creator>
		<pubDate>Wed, 18 Mar 2009 10:51:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.jonathansng.com/?p=147#comment-719</guid>
		<description>A great tutorial! I was trying to understand what a foreign_key does. Thanks for the explanation.</description>
		<content:encoded><![CDATA[<p>A great tutorial! I was trying to understand what a foreign_key does. Thanks for the explanation.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kyeno</title>
		<link>http://jonathanng.com/ruby-on-rails/rails-relationships/comment-page-2/#comment-611</link>
		<dc:creator>Kyeno</dc:creator>
		<pubDate>Thu, 21 Aug 2008 22:40:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.jonathansng.com/?p=147#comment-611</guid>
		<description>Hi there!
I&#039;ve been through all of Your tutorials so far and i must say - You&#039;re the best. I&#039;m a classic LAMP developer who once decided to try switching to rails. I began with learning the Ruby language itself and it&#039;s syntax, but it never brought me to any clue on Rails - which isn&#039;t perfectly documented... Your tutorials are making the beginners life easier! Thanks!

Btw, i tried to introduce the very basics of (M)VC structure in PHP to some wider range of HTML developers by writing my own tutorial about it. Not sure if it&#039;s a good place to share, but hope some1 would find it interesting as well http://blog.thepixers.com/2008/07/tutorial-micro-cms-for-htmlcss-developers/

Cheers, keep up the good work! :)</description>
		<content:encoded><![CDATA[<p>Hi there!<br />
I&#8217;ve been through all of Your tutorials so far and i must say &#8211; You&#8217;re the best. I&#8217;m a classic LAMP developer who once decided to try switching to rails. I began with learning the Ruby language itself and it&#8217;s syntax, but it never brought me to any clue on Rails &#8211; which isn&#8217;t perfectly documented&#8230; Your tutorials are making the beginners life easier! Thanks!</p>
<p>Btw, i tried to introduce the very basics of (M)VC structure in PHP to some wider range of HTML developers by writing my own tutorial about it. Not sure if it&#8217;s a good place to share, but hope some1 would find it interesting as well <a href="http://blog.thepixers.com/2008/07/tutorial-micro-cms-for-htmlcss-developers/" rel="nofollow">http://blog.thepixers.com/2008/07/tutorial-micro-cms-for-htmlcss-developers/</a></p>
<p>Cheers, keep up the good work! <img src='http://jonathanng.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jefe</title>
		<link>http://jonathanng.com/ruby-on-rails/rails-relationships/comment-page-2/#comment-503</link>
		<dc:creator>jefe</dc:creator>
		<pubDate>Mon, 21 Jul 2008 17:27:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.jonathansng.com/?p=147#comment-503</guid>
		<description>Jonathan,

Your tutorials are excellent.  I&#039;d like to make a request regarding this one, Rails Relationships.  I will be working with an existing database where all tables, constraints, and relationships are defined in the DBMS as opposed to using Rails Migrations.  I (and I&#039;m sure others) would appreciate any additional info you may have regarding best practices in building Ruby/Rails 2.x applications using legacy databases. The only thing I&#039;ve found so far is this wiki, 

http://wiki.rubyonrails.com/rails/pages/HowToUseLegacySchemas

which isn&#039;t all that helpful in practice.

Thanks for your consideration

jefe</description>
		<content:encoded><![CDATA[<p>Jonathan,</p>
<p>Your tutorials are excellent.  I&#8217;d like to make a request regarding this one, Rails Relationships.  I will be working with an existing database where all tables, constraints, and relationships are defined in the DBMS as opposed to using Rails Migrations.  I (and I&#8217;m sure others) would appreciate any additional info you may have regarding best practices in building Ruby/Rails 2.x applications using legacy databases. The only thing I&#8217;ve found so far is this wiki, </p>
<p><a href="http://wiki.rubyonrails.com/rails/pages/HowToUseLegacySchemas" rel="nofollow">http://wiki.rubyonrails.com/rails/pages/HowToUseLegacySchemas</a></p>
<p>which isn&#8217;t all that helpful in practice.</p>
<p>Thanks for your consideration</p>
<p>jefe</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: aaron</title>
		<link>http://jonathanng.com/ruby-on-rails/rails-relationships/comment-page-1/#comment-491</link>
		<dc:creator>aaron</dc:creator>
		<pubDate>Sat, 19 Jul 2008 20:13:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.jonathansng.com/?p=147#comment-491</guid>
		<description>Uh, where is the article? I was looking forward to it but only the comments show up?</description>
		<content:encoded><![CDATA[<p>Uh, where is the article? I was looking forward to it but only the comments show up?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David</title>
		<link>http://jonathanng.com/ruby-on-rails/rails-relationships/comment-page-1/#comment-449</link>
		<dc:creator>David</dc:creator>
		<pubDate>Tue, 01 Jul 2008 20:58:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.jonathansng.com/?p=147#comment-449</guid>
		<description>Hi Jonathan,

Great series of tutorials!

I found this slight error in your section called &quot;Rails Associations.&quot;

You have:
Open up your model/book.rb and model/author.rb and add the following lines of code:

# in model/author.rb
^^^^^^^^^^^^^^^^^^^^
class Book &lt; ActiveRecord::Base
  belongs_to :author
end

# in model/author.rb
class Author &lt; ActiveRecord::Base
  has_many :books
end

But I think the book class&#039; comment should read:
# in model/book.rb

Hope this makes sense, if it doesn&#039;t drop me an email, and I&#039;ll try to explain it better ;).

David</description>
		<content:encoded><![CDATA[<p>Hi Jonathan,</p>
<p>Great series of tutorials!</p>
<p>I found this slight error in your section called &#8220;Rails Associations.&#8221;</p>
<p>You have:<br />
Open up your model/book.rb and model/author.rb and add the following lines of code:</p>
<p># in model/author.rb<br />
^^^^^^^^^^^^^^^^^^^^<br />
class Book &lt; ActiveRecord::Base<br />
  belongs_to :author<br />
end</p>
<p># in model/author.rb<br />
class Author &lt; ActiveRecord::Base<br />
  has_many :books<br />
end</p>
<p>But I think the book class&#8217; comment should read:<br />
# in model/book.rb</p>
<p>Hope this makes sense, if it doesn&#8217;t drop me an email, and I&#8217;ll try to explain it better <img src='http://jonathanng.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> .</p>
<p>David</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Amrita</title>
		<link>http://jonathanng.com/ruby-on-rails/rails-relationships/comment-page-1/#comment-428</link>
		<dc:creator>Amrita</dc:creator>
		<pubDate>Tue, 24 Jun 2008 23:32:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.jonathansng.com/?p=147#comment-428</guid>
		<description>Thanks, Jonathan, for posting such a wonderful tutorial. I implemented the application and got everything to work. Now I am trying to get the authors&#039; page to provide a link to all books authored by each author. How do I go about doing this? In particular, I would like to understand better how the view interacts with the controller and how controllers of different models can interact.

I apologize if I sound technically incorrect. I have been doing RoR for all of 3 days now and had a long break from OOP.

Thanks a lot!</description>
		<content:encoded><![CDATA[<p>Thanks, Jonathan, for posting such a wonderful tutorial. I implemented the application and got everything to work. Now I am trying to get the authors&#8217; page to provide a link to all books authored by each author. How do I go about doing this? In particular, I would like to understand better how the view interacts with the controller and how controllers of different models can interact.</p>
<p>I apologize if I sound technically incorrect. I have been doing RoR for all of 3 days now and had a long break from OOP.</p>
<p>Thanks a lot!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andy</title>
		<link>http://jonathanng.com/ruby-on-rails/rails-relationships/comment-page-1/#comment-427</link>
		<dc:creator>Andy</dc:creator>
		<pubDate>Mon, 23 Jun 2008 18:57:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.jonathansng.com/?p=147#comment-427</guid>
		<description>Ignore my last comments. After going over it like 10 times, and resetting the local server, and raking it, resetting it, and nothing working, I went to lunch, and when I came back it started to work for no reason....... O well great Guide!!! Thanks a million.</description>
		<content:encoded><![CDATA[<p>Ignore my last comments. After going over it like 10 times, and resetting the local server, and raking it, resetting it, and nothing working, I went to lunch, and when I came back it started to work for no reason&#8230;&#8230;. O well great Guide!!! Thanks a million.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andy</title>
		<link>http://jonathanng.com/ruby-on-rails/rails-relationships/comment-page-1/#comment-425</link>
		<dc:creator>Andy</dc:creator>
		<pubDate>Mon, 23 Jun 2008 15:57:28 +0000</pubDate>
		<guid isPermaLink="false">http://www.jonathansng.com/?p=147#comment-425</guid>
		<description>*I put (%=h book.author.name %&gt; into the *</description>
		<content:encoded><![CDATA[<p>*I put (%=h book.author.name %&gt; into the *</p>
]]></content:encoded>
	</item>
</channel>
</rss>
