<?xml version="1.0" encoding="UTF-8"?>
<posts>
  <post>
    <body>Hey so on page 36 I run said command in monkey and I get the error:

/Users/ianhenrysmith/monkey/config/boot.rb:45:in `require': no such file to load -- /Users/ianhenrysmith/monkey/config/../vendor/rails/railties/lib/initializer (LoadError)
	from /Users/ianhenrysmith/monkey/config/boot.rb:45:in `load_initializer'
	from /Users/ianhenrysmith/monkey/config/boot.rb:38:in `run'
	from /Users/ianhenrysmith/monkey/config/boot.rb:11:in `boot!'
	from /Users/ianhenrysmith/monkey/config/boot.rb:110
	from script/generate:2:in `require'
	from script/generate:2

Haven't run into any problems so far setting up rails or the db or anything. Thanks!</body>
    <body-html>&lt;p&gt;Hey so on page 36 I run said command in monkey and I get the error:&lt;/p&gt;


	&lt;p&gt;/Users/ianhenrysmith/monkey/config/boot.rb:45:in `require&amp;#8217;: no such file to load&amp;#8212;/Users/ianhenrysmith/monkey/config/../vendor/rails/railties/lib/initializer (LoadError)
    from /Users/ianhenrysmith/monkey/config/boot.rb:45:in `load_initializer&amp;#8217;
    from /Users/ianhenrysmith/monkey/config/boot.rb:38:in `run&amp;#8217;
    from /Users/ianhenrysmith/monkey/config/boot.rb:11:in `boot!&amp;#8217;
    from /Users/ianhenrysmith/monkey/config/boot.rb:110
    from script/generate:2:in `require&amp;#8217;
    from script/generate:2&lt;/p&gt;


	&lt;p&gt;Haven&amp;#8217;t run into any problems so far setting up rails or the db or anything. Thanks!&lt;/p&gt;</body-html>
    <created-at type="datetime">2010-03-08T17:36:24Z</created-at>
    <forum-id type="integer">3</forum-id>
    <id type="integer">532</id>
    <topic-id type="integer">174</topic-id>
    <updated-at type="datetime">2010-03-08T17:36:24Z</updated-at>
    <user-id type="integer">237</user-id>
  </post>
  <post>
    <body>"see this topic":http://railsprojects.com/forums/3/topics/173</body>
    <body-html>&lt;p&gt;&lt;a href="http://railsprojects.com/forums/3/topics/173"&gt;see this topic&lt;/a&gt;&lt;/p&gt;</body-html>
    <created-at type="datetime">2010-02-22T02:14:37Z</created-at>
    <forum-id type="integer">3</forum-id>
    <id type="integer">531</id>
    <topic-id type="integer">170</topic-id>
    <updated-at type="datetime">2010-02-22T02:15:21Z</updated-at>
    <user-id type="integer">1</user-id>
  </post>
  <post>
    <body>I've had a number of people contact me over the last couple of months (which unfortunately have been far more hectic for me than usual) with questions about upgrading some of the books projects to the current version of Rails 2.3.5.

Since the projects in the book were all written in 1.2.6, and Rails has a bad habit of having non-backward compatible changes - this has caused some issues for people. Unfortunately - I don't have time to update all the books projects but thought I would at least put together a Rails 2.3.5 compatible version of Monkey Tasks for people to use as a reference.

You can download it from &lt;a href="http://www.foundationrails.com/monkey235.zip"&gt;here&lt;/a&gt;.

One key thing to remember is that this version is Rails 2.3.5 COMPATIBLE, which is quite different from being up to date with Rails 2.3.5 standards. A lot has changed in Rails and in how Rails developers build applications since the book was published and there were quite a few times during my updates that I was wanting to throw huge chunks of code away to update them to the newer standards, however I thought that might cause even more confusion so I kept my changes more in line with how the book was written.</body>
    <body-html>&lt;p&gt;I&amp;#8217;ve had a number of people contact me over the last couple of months (which unfortunately have been far more hectic for me than usual) with questions about upgrading some of the books projects to the current version of Rails 2.3.5.&lt;/p&gt;


	&lt;p&gt;Since the projects in the book were all written in 1.2.6, and Rails has a bad habit of having non-backward compatible changes &amp;#8211; this has caused some issues for people. Unfortunately &amp;#8211; I don&amp;#8217;t have time to update all the books projects but thought I would at least put together a Rails 2.3.5 compatible version of Monkey Tasks for people to use as a reference.&lt;/p&gt;


	&lt;p&gt;You can download it from &lt;a href="http://www.foundationrails.com/monkey235.zip"&gt;here&lt;/a&gt;.&lt;/p&gt;


	&lt;p&gt;One key thing to remember is that this version is Rails 2.3.5 &lt;span class="caps"&gt;COMPATIBLE&lt;/span&gt;, which is quite different from being up to date with Rails 2.3.5 standards. A lot has changed in Rails and in how Rails developers build applications since the book was published and there were quite a few times during my updates that I was wanting to throw huge chunks of code away to update them to the newer standards, however I thought that might cause even more confusion so I kept my changes more in line with how the book was written.&lt;/p&gt;</body-html>
    <created-at type="datetime">2010-02-22T02:14:11Z</created-at>
    <forum-id type="integer">3</forum-id>
    <id type="integer">530</id>
    <topic-id type="integer">173</topic-id>
    <updated-at type="datetime">2010-02-22T02:14:11Z</updated-at>
    <user-id type="integer">1</user-id>
  </post>
  <post>
    <body>Adding link to an Rails 2.3.5 version of the Monkey Tasks project - you might want to check it's source out and compare it against yours.</body>
    <body-html>&lt;p&gt;Adding link to an Rails 2.3.5 version of the Monkey Tasks project &amp;#8211; you might want to check it&amp;#8217;s source out and compare it against yours.&lt;/p&gt;</body-html>
    <created-at type="datetime">2010-02-22T02:00:42Z</created-at>
    <forum-id type="integer">3</forum-id>
    <id type="integer">529</id>
    <topic-id type="integer">172</topic-id>
    <updated-at type="datetime">2010-02-22T02:00:42Z</updated-at>
    <user-id type="integer">1</user-id>
  </post>
  <post>
    <body>Have you tried setting action_mailer to user sendmail instead?

i.e. in environment.rb 
&lt;pre&gt;  config.action_mailer.delivery_method = :sendmail&lt;/pre&gt;</body>
    <body-html>&lt;p&gt;Have you tried setting action_mailer to user sendmail instead?&lt;/p&gt;


	&lt;p&gt;i.e. in environment.rb &lt;br /&gt;&lt;pre&gt;  config.action_mailer.delivery_method = :sendmail&lt;/pre&gt;&lt;/p&gt;</body-html>
    <created-at type="datetime">2010-02-22T01:59:21Z</created-at>
    <forum-id type="integer">3</forum-id>
    <id type="integer">528</id>
    <topic-id type="integer">171</topic-id>
    <updated-at type="datetime">2010-02-22T01:59:21Z</updated-at>
    <user-id type="integer">1</user-id>
  </post>
  <post>
    <body>fixed.  never mind.  except i notice that when I mark a task as complete, I need to click the browser refresh button to strike it and move it to the bottom.  I also notice in the console that the *complete* variable is always null.</body>
    <body-html>&lt;p&gt;fixed.  never mind.  except i notice that when I mark a task as complete, I need to click the browser refresh button to strike it and move it to the bottom.  I also notice in the console that the &lt;strong&gt;complete&lt;/strong&gt; variable is always null.&lt;/p&gt;</body-html>
    <created-at type="datetime">2010-02-18T04:04:10Z</created-at>
    <forum-id type="integer">3</forum-id>
    <id type="integer">527</id>
    <topic-id type="integer">172</topic-id>
    <updated-at type="datetime">2010-02-18T04:04:10Z</updated-at>
    <user-id type="integer">234</user-id>
  </post>
  <post>
    <body>Just added the mark_complete method to the task controller and get this error message every time.  Here is the snippet:

def mark_complete 
    if @task.complete.nil? 
      @task.complete = Time.now &lt;-- this line is the culprit --&gt;
      @task.todo.move_to_bottom 
    else 
      @task.complete = nil 
    end 
    @task.save! 
    redirect_to :controller =&gt; :today, :action =&gt; :index
  end  

It must be something syntactical.  Any ideas?</body>
    <body-html>&lt;p&gt;Just added the mark_complete method to the task controller and get this error message every time.  Here is the snippet:&lt;/p&gt;


	&lt;p&gt;def mark_complete 
    if @task.complete.nil? 
      @task.complete = Time.now &amp;lt;&lt;del&gt;- this line is the culprit -&lt;/del&gt;&amp;gt;
      @task.todo.move_to_bottom 
    else 
      @task.complete = nil 
    end 
    @task.save! 
    redirect_to :controller =&amp;gt; :today, :action =&amp;gt; :index
  end&lt;/p&gt;


	&lt;p&gt;It must be something syntactical.  Any ideas?&lt;/p&gt;</body-html>
    <created-at type="datetime">2010-02-18T00:47:23Z</created-at>
    <forum-id type="integer">3</forum-id>
    <id type="integer">526</id>
    <topic-id type="integer">172</topic-id>
    <updated-at type="datetime">2010-02-18T00:47:23Z</updated-at>
    <user-id type="integer">234</user-id>
  </post>
  <post>
    <body>Hi all..
I've completed chapter 3 and am so close to moving on but unfortunatley I can't
complete the signup process cuz i keep getting this error:

Net::SMTPUnknownError in AccountController#signup

C:/Ruby/lib/ruby/1.8/net/smtp.rb:679:in `check_response'
C:/Ruby/lib/ruby/1.8/net/smtp.rb:395:in `do_start'
C:/Ruby/lib/ruby/1.8/net/smtp.rb:377:in `start'
C:/Ruby/lib/ruby/gems/1.8/gems/actionmailer-2.3.4/lib/action_mailer/base.rb:682:in `perform_delivery_smtp'
C:/Ruby/lib/ruby/gems/1.8/gems/actionmailer-2.3.4/lib/action_mailer/base.rb:523:in `__send__'
C:/Ruby/lib/ruby/gems/1.8/gems/actionmailer-2.3.4/lib/action_mailer/base.rb:523:in `deliver!'
C:/Ruby/lib/ruby/gems/1.8/gems/actionmailer-2.3.4/lib/action_mailer/base.rb:395:in `method_missing'
E:/rails/monkey/app/models/user_observer.rb:3:in `after_create'
E:/rails/monkey/app/controllers/account_controller.rb:24:in `signup'

I've checked the code over many times and it seems to be fine :(
Can anyone shed some light on what i might be missing or doing wrong??
Thx 
erick</body>
    <body-html>&lt;p&gt;Hi all..&lt;br /&gt;I&amp;#8217;ve completed chapter 3 and am so close to moving on but unfortunatley I can&amp;#8217;t&lt;br /&gt;complete the signup process cuz i keep getting this error:&lt;/p&gt;


	&lt;p&gt;Net::SMTPUnknownError in AccountController#signup&lt;/p&gt;


	&lt;p&gt;C:/Ruby/lib/ruby/1.8/net/smtp.rb:679:in `check_response&amp;#8217;&lt;br /&gt;C:/Ruby/lib/ruby/1.8/net/smtp.rb:395:in `do_start&amp;#8217;&lt;br /&gt;C:/Ruby/lib/ruby/1.8/net/smtp.rb:377:in `start&amp;#8217;&lt;br /&gt;C:/Ruby/lib/ruby/gems/1.8/gems/actionmailer-2.3.4/lib/action_mailer/base.rb:682:in `perform_delivery_smtp&amp;#8217;&lt;br /&gt;C:/Ruby/lib/ruby/gems/1.8/gems/actionmailer-2.3.4/lib/action_mailer/base.rb:523:in `&lt;i&gt;send&lt;/i&gt;&amp;#8216;&lt;br /&gt;C:/Ruby/lib/ruby/gems/1.8/gems/actionmailer-2.3.4/lib/action_mailer/base.rb:523:in `deliver!&amp;#8217;&lt;br /&gt;C:/Ruby/lib/ruby/gems/1.8/gems/actionmailer-2.3.4/lib/action_mailer/base.rb:395:in `method_missing&amp;#8217;&lt;br /&gt;E:/rails/monkey/app/models/user_observer.rb:3:in `after_create&amp;#8217;&lt;br /&gt;E:/rails/monkey/app/controllers/account_controller.rb:24:in `signup&amp;#8217;&lt;/p&gt;


	&lt;p&gt;I&amp;#8217;ve checked the code over many times and it seems to be fine :(&lt;br /&gt;Can anyone shed some light on what i might be missing or doing wrong??&lt;br /&gt;Thx &lt;br /&gt;erick&lt;/p&gt;</body-html>
    <created-at type="datetime">2010-01-25T13:07:34Z</created-at>
    <forum-id type="integer">3</forum-id>
    <id type="integer">525</id>
    <topic-id type="integer">171</topic-id>
    <updated-at type="datetime">2010-01-25T13:07:34Z</updated-at>
    <user-id type="integer">232</user-id>
  </post>
  <post>
    <body>Hi,

I have installed Rails 2.3.5 and ruby 1.9.1 into a ubuntu virtual box.

I was OK upto page 74, but @todos = @today.todos casued a problem. That turned out to be because I did not have the acts_as_list plugin.

I got further errors that seemed to stem from the tasks I created, so I cleared out the tables in sqlite3 to start again.

Now I get:
Processing TodayController#index (for 127.0.0.1 at 2010-01-13 15:59:15) [GET]
  User Load (0.5ms)   SELECT * FROM "users" WHERE ("users"."id" = 1) LIMIT 1
  Schedule Load (2.3ms)   SELECT * FROM "schedules" WHERE ("schedules".user_id = 1 AND (today = '2010-01-13')) LIMIT 1
  Todo Load (0.3ms)   SELECT * FROM "todos" WHERE (schedule_id IS NULL) ORDER BY position DESC LIMIT 1
  Todo Create (0.5ms)   INSERT INTO "todos" ("schedule_id", "task_id", "position") VALUES(NULL, NULL, 3)

TypeError (nil is not a symbol):
  app/models/todo.rb:6:in `&lt;class:Todo&gt;'
  app/models/todo.rb:1:in `&lt;top (required)&gt;'
  app/controllers/today_controller.rb:6:in `index'
  &lt;internal:prelude&gt;:8:in `synchronize'
  /home/andy/.rvm/ruby-1.9.1-p376/lib/ruby/1.9.1/webrick/httpserver.rb:111:in `service'
  /home/andy/.rvm/ruby-1.9.1-p376/lib/ruby/1.9.1/webrick/httpserver.rb:70:in `run'
  /home/andy/.rvm/ruby-1.9.1-p376/lib/ruby/1.9.1/webrick/server.rb:183:in `block in start_thread'


I tried the complete source from the website in a different directory, but it was not happy with my version.

Anyone got this project to work in the ruby and rails versions indicated?

...Andy</body>
    <body-html>&lt;p&gt;Hi,&lt;/p&gt;


	&lt;p&gt;I have installed Rails 2.3.5 and ruby 1.9.1 into a ubuntu virtual box.&lt;/p&gt;


	&lt;p&gt;I was OK upto page 74, but @todos = @today.todos casued a problem. That turned out to be because I did not have the acts_as_list plugin.&lt;/p&gt;


	&lt;p&gt;I got further errors that seemed to stem from the tasks I created, so I cleared out the tables in sqlite3 to start again.&lt;/p&gt;


	&lt;p&gt;Now I get:&lt;br /&gt;Processing TodayController#index (for 127.0.0.1 at 2010-01-13 15:59:15) [GET]
  User Load (0.5ms)   &lt;span class="caps"&gt;SELECT&lt;/span&gt; * &lt;span class="caps"&gt;FROM&lt;/span&gt; &amp;#8220;users&amp;#8221; &lt;span class="caps"&gt;WHERE&lt;/span&gt; (&amp;#8220;users&amp;#8221;.&amp;#8221;id&amp;#8221; = 1) &lt;span class="caps"&gt;LIMIT 1&lt;/span&gt;
  Schedule Load (2.3ms)   &lt;span class="caps"&gt;SELECT&lt;/span&gt; * &lt;span class="caps"&gt;FROM&lt;/span&gt; &amp;#8220;schedules&amp;#8221; &lt;span class="caps"&gt;WHERE&lt;/span&gt; (&amp;#8220;schedules&amp;#8221;.user_id = 1 &lt;span class="caps"&gt;AND&lt;/span&gt; (today = &amp;#8216;2010-01-13&amp;#8217;)) &lt;span class="caps"&gt;LIMIT 1&lt;/span&gt;
  Todo Load (0.3ms)   &lt;span class="caps"&gt;SELECT&lt;/span&gt; * &lt;span class="caps"&gt;FROM&lt;/span&gt; &amp;#8220;todos&amp;#8221; &lt;span class="caps"&gt;WHERE&lt;/span&gt; (schedule_id &lt;span class="caps"&gt;IS NULL&lt;/span&gt;) ORDER BY position &lt;span class="caps"&gt;DESC LIMIT 1&lt;/span&gt;
  Todo Create (0.5ms)   &lt;span class="caps"&gt;INSERT INTO&lt;/span&gt; &amp;#8220;todos&amp;#8221; (&amp;#8220;schedule_id&amp;#8221;, &amp;#8220;task_id&amp;#8221;, &amp;#8220;position&amp;#8221;) &lt;acronym title="NULL, &lt;span class="&gt;VALUES&lt;/acronym&gt;&lt;/p&gt;


	&lt;p&gt;TypeError (nil is not a symbol):
  app/models/todo.rb:6:in `&amp;lt;class:todo&gt;&amp;#8216;
  app/models/todo.rb:1:in `&amp;lt;top&gt;&amp;#8216;
  app/controllers/today_controller.rb:6:in `index&amp;#8217;
  &amp;lt;internal:prelude&gt;:8:in `synchronize&amp;#8217;
  /home/andy/.rvm/ruby-1.9.1-p376/lib/ruby/1.9.1/webrick/httpserver.rb:111:in `service&amp;#8217;
  /home/andy/.rvm/ruby-1.9.1-p376/lib/ruby/1.9.1/webrick/httpserver.rb:70:in `run&amp;#8217;
  /home/andy/.rvm/ruby-1.9.1-p376/lib/ruby/1.9.1/webrick/server.rb:183:in `block in start_thread&amp;#8217;&lt;/p&gt;


	&lt;p&gt;I tried the complete source from the website in a different directory, but it was not happy with my version.&lt;/p&gt;


	&lt;p&gt;Anyone got this project to work in the ruby and rails versions indicated?&lt;/p&gt;


	&lt;p&gt;...Andy&lt;/p&gt;</body-html>
    <created-at type="datetime">2010-01-13T16:36:17Z</created-at>
    <forum-id type="integer">3</forum-id>
    <id type="integer">524</id>
    <topic-id type="integer">170</topic-id>
    <updated-at type="datetime">2010-01-13T16:36:17Z</updated-at>
    <user-id type="integer">231</user-id>
  </post>
  <post>
    <body>I found another solution that did not involve the config/environments/development.rb change for config.cache_classes = true...
I have no idea why it works, but it fixed the problem in my setup (Linux, MySQL, mongrel_rails...).  This was an especially frustrating problem because sometimes it would work (immediately after a server restart), then on any page refresh it would fail.

Take the comment.rb file from vendor/plugins/acts_as_commentable/lib directory and move it to app/models/comment.rb
Restart your server (mongrel_rails restart) and it should do the trick.  Now the comment.user model will behave as a "proper" user object, having the correct methods and attributed available to the template.</body>
    <body-html>&lt;p&gt;I found another solution that did not involve the config/environments/development.rb change for config.cache_classes = true&amp;#8230;&lt;br /&gt;I have no idea why it works, but it fixed the problem in my setup (Linux, MySQL, mongrel_rails&amp;#8230;).  This was an especially frustrating problem because sometimes it would work (immediately after a server restart), then on any page refresh it would fail.&lt;/p&gt;


	&lt;p&gt;Take the comment.rb file from vendor/plugins/acts_as_commentable/lib directory and move it to app/models/comment.rb&lt;br /&gt;Restart your server (mongrel_rails restart) and it should do the trick.  Now the comment.user model will behave as a &amp;#8220;proper&amp;#8221; user object, having the correct methods and attributed available to the template.&lt;/p&gt;</body-html>
    <created-at type="datetime">2009-08-19T01:47:35Z</created-at>
    <forum-id type="integer">7</forum-id>
    <id type="integer">472</id>
    <topic-id type="integer">106</topic-id>
    <updated-at type="datetime">2009-08-19T01:47:35Z</updated-at>
    <user-id type="integer">183</user-id>
  </post>
  <post>
    <body>I have just been looking into the source of GamingTrends, since I want to use Rails with ExtJS and find it a somewhat good inspiration. 

To get up and running I first had to setup the MySql database with the schema. I had problems using the migrations. I got some errors on the E304 and descrip index og Games. (BLOG/TEXT requires a length key, tried adding a :limit =&gt; 1000, but didn't work!?) 

To import the schema into a mysql database, I recommend removing Games indexes "E304" and "descrip" from the first migration. They are deleted on the cleanup migrations anyways!

Finally I got the app up and running, but I was unable to create Posts!

in the source code
/app/views/post/index.rhtml
- Contains Headline x 2, missing FrontPage attribute, title should be "Create New Story"

/app/views/post/new.rhtml
- Same errors as in index.rhtml, replace second (duplicate) "Headline" with "FrontPage"

--

Looking into the code:

I feel the ExtJS infrastructure can be vastly improved by scrapping the ext helper function in application_helper.rb and refactoring them. 
The current design is not very DRY and the multiple " function &lt;&lt; ..." statements to build up the ExtJS javascript is not exactly pretty.

I came up with the following refactoring solution:
--------------------------------------

application_helper.rb
----------------
  # model, primary_key, fields, columns, height, width, pageSize, newsFun 
  def ext_grid(options = {})
    xml_fields = fields
    xml_fields &lt;&lt; primary_key
    xml_fields.collect! {|x| "'#{x}'"}
    models = model.pluralize
    options.merge!(xml_fields, models)
    render_ext_js('ext_grid', options)
    render_ext_js('news_fun', options) if newsFun
  end  

  def render_ext_js(name, options)
    javascript_tag(render(:partial =&gt; "shared/ext_grid", :locals =&gt; options))
  end



games/index.rhtml
---------------

&lt;%= ext_layout('Games') %&gt;
&lt;%= ext_grid(:optons =&gt; {:model =&gt; "game", :primary_key =&gt; "GameID", :fields =&gt; %w(Title Console),
  :columns =&gt; "{header: 'Title', width: 300, dataIndex: 'Title'}, {header: 'Console', width: 250, dataIndex: 'Console'}", :height =&gt; 340, :width =&gt; 530, :pageSize =&gt; 13}) %&gt;



shared/_ext_grid.rhtml
------------------
var pageGrid = function() {
	var grid; 
	var dialog; 
	var ds;
 
	return { 
		init : function(){
 			ds = new Ext.data.Store({    
 			proxy: new Ext.data.HttpProxy({
				method: 'GET', 
				url: '&lt;%= models %&gt;.json'}),
				reader: new Ext.data.JsonReader({
					root: '&lt;%= models %&gt;',
 					totalProperty: 'totalCount',
 					id: '&lt;%= primary_key %&gt;'
				}, 
				[&lt;%= xml_fields.to_sentence(:connector =&gt; '') %&gt;])
 			});    

			var cm = new Ext.grid.ColumnModel([&lt;%= columns %&gt;]);
			cm.defaultSortable = true;
			grid = new Ext.grid.Grid(
				'content', 
				{ ds: ds, cm: cm }
			);    
			grid.render();

			var gridFoot = grid.getView().getFooterPanel(true);
			var paging = new Ext.PagingToolbar(gridFoot, ds, {
				pageSize: &lt;%= pageSize %&gt;,
				displayInfo: true,
				displayMsg: 'Displaying topics {0} - {1} of {2}',    
				emptyMsg: 'No topics to display'
			});
			ds.load({
				params:{start:0, limit:&lt;%= pageSize %&gt;}
			});

			grid.on('rowdblclick', editResource);

			var gridHead = grid.getView().getHeaderPanel(true);
			var tb = new Ext.Toolbar(gridHead);
			tb.add(
				{ 
					text: 'Create New &lt;%= model %&gt;', 
					handler: createResource 
				}, 
				'-', 
				{ 
					text: 'Delete Selected  &lt;%= model %&gt;', 
					handler: deleteResource 
				}
			);
			tb.add(
				'-', 
				'Filter: ', 
				"&lt;input type='text' id='text_filter'&gt;"
			);
			Ext.get('text_filter').on('keyup', filterResource);

		}
	}
}();    


PageGrid.filterResource = function() {
	filtervalue = Ext.get('text_filter').dom.value;
	ds.proxy = new Ext.data.HttpProxy({
		method: 'GET', 
		url: '&lt;%= models %&gt;.json?search=' + filtervalue}
	);
	ds.reload();
}

PageGrid.deleteResource = function() {
	var id = grid.getSelectionModel().getSelected(); 
	if(id){
		Ext.MessageBox.confirm('Confirm', 'Are you sure you want to delete this &lt;%= model %&gt;?', postDelete);
	} else {
		Ext.MessageBox.alert('DOH!', 'Maybe you want to try again after ACTUALLY selecting something?')
	}
}

PageGrid.submitResource = function(){
	document.create_resource.submit();
}

PageGrid.postDelete = function(btn){
	if(btn == 'yes') {
		var id = grid.getSelectionModel().getSelected();
		var deleteme = id.get('&lt;%= primary_key %&gt;');
		window.location.href = '/&lt;%= models %&gt;/destroy/' + deleteme;
	}
}

PageGrid.editResource = function (grid, rowIndex) {
	var id = grid.getSelectionModel().getSelected();
	if(id) { 
		window.location.href = '/&lt;%= models %&gt;/' + id.get('&lt;%= primary_key %&gt;'); 
	}
}
// width:500, 630, pageSize:13, 20
PageGrid.createResource = function() {
	if(!dialog) {
		dialog = new Ext.BasicDialog('newDialog', {
			width: &lt;%= width %&gt;, 
			height:&lt;%= height %&gt;, 
			shadow:true, 
			minWidth:300, 
			minHeight:&lt;%= height %&gt;, 
			proxyDrag:true, 
			autoScroll:false, 
			animEl:true 
		});
		dialog.addKeyListener(27, dialog.hide, dialog);
		postBtn = dialog.addButton('Submit', submitResource, this);
		dialog.addButton('Close', dialog.hide, dialog); 
	}
	dialog.show();
	dialog.on('hide', function(){
		document.create_resource.reset();
	})    
} 


Ext.onReady(pageGrid.init, pageGrid, true);


shared/_news_fun.rhtml
-------------------

PageGrid.renderNews = function(value, p, record) {
	return String.format('&lt;b&gt;{0}&lt;/b&gt;&lt;br /&gt;{1}', value, Ext.util.Format.stripTags(record.data['Body']).substr(0,100) + "....");
}

PageGrid.renderNewsPlain = function(value) {
   	return String.format('&lt;b&gt;&lt;i&gt;{0}&lt;/i&gt;&lt;/b&gt;', value); 
}


PageGrid.toggleNews = function(btn, pressed) {
	cm.getColumnById('Headline').renderer = pressed ? renderNews : renderNewsPlain;
	grid.getView().refresh(); 
}

  
var formatBoolean = function (value) {
	return (value == 1) ? 'Yes' : '&lt;b class=\"alert\"&gt;No&lt;/b&gt;';
}

--------

The &lt;div id="newDialog"&gt; in each index.rhtml also looks similar to the 'content' div in new, and there is a pattern between each of these across all models. I'm sure they could also be nicely refactored.

posts/show.rhtml contains a lot of ext js code which could also be put in a separate partial IMO. I will see where I get from here...</body>
    <body-html>&lt;p&gt;I have just been looking into the source of GamingTrends, since I want to use Rails with ExtJS and find it a somewhat good inspiration.&lt;/p&gt;


	&lt;p&gt;To get up and running I first had to setup the MySql database with the schema. I had problems using the migrations. I got some errors on the &lt;span class="caps"&gt;E304&lt;/span&gt; and descrip index og Games. (BLOG/TEXT requires a length key, tried adding a :limit =&amp;gt; 1000, but didn&amp;#8217;t work!?)&lt;/p&gt;


	&lt;p&gt;To import the schema into a mysql database, I recommend removing Games indexes &amp;#8220;E304&amp;#8221; and &amp;#8220;descrip&amp;#8221; from the first migration. They are deleted on the cleanup migrations anyways!&lt;/p&gt;


	&lt;p&gt;Finally I got the app up and running, but I was unable to create Posts!&lt;/p&gt;


	&lt;p&gt;in the source code&lt;br /&gt;/app/views/post/index.rhtml&lt;br /&gt;- Contains Headline x 2, missing FrontPage attribute, title should be &amp;#8220;Create New Story&amp;#8221;&lt;/p&gt;


	&lt;p&gt;/app/views/post/new.rhtml&lt;br /&gt;- Same errors as in index.rhtml, replace second (duplicate) &amp;#8220;Headline&amp;#8221; with &amp;#8220;FrontPage&amp;#8221;&lt;/p&gt;


	&lt;p&gt;&amp;#8212;&lt;/p&gt;


	&lt;p&gt;Looking into the code:&lt;/p&gt;


	&lt;p&gt;I feel the ExtJS infrastructure can be vastly improved by scrapping the ext helper function in application_helper.rb and refactoring them. &lt;br /&gt;The current design is not very &lt;span class="caps"&gt;DRY&lt;/span&gt; and the multiple &amp;#8221; function &amp;lt;&amp;lt; ...&amp;#8221; statements to build up the ExtJS javascript is not exactly pretty.&lt;/p&gt;


	&lt;p&gt;I came up with the following refactoring solution:&lt;br /&gt;&lt;del&gt;&amp;#8212;&lt;/del&gt;-&lt;del&gt;&amp;#8212;&lt;/del&gt;-&lt;del&gt;&amp;#8212;&lt;/del&gt;-&lt;del&gt;&amp;#8212;&lt;/del&gt;-&lt;del&gt;&amp;#8212;&lt;/del&gt;-&lt;del&gt;&amp;#8212;&lt;/del&gt;-&lt;del&gt;&amp;#8212;&lt;/del&gt;-&lt;del&gt;-&lt;/del&gt;&lt;/p&gt;


	&lt;p&gt;application_helper.rb&lt;br /&gt;&lt;del&gt;&amp;#8212;&lt;/del&gt;-&lt;del&gt;&amp;#8212;&lt;/del&gt;-&lt;del&gt;&amp;#8212;&lt;/del&gt;&amp;#8212;
  # model, primary_key, fields, columns, height, width, pageSize, newsFun 
  def ext_grid(options = {})
    xml_fields = fields
    xml_fields &amp;lt;&amp;lt; primary_key
    xml_fields.collect! {|x| &amp;#8221;&amp;#8217;#{x}&amp;#8217;&amp;#8221;}
    models = model.pluralize
    options.merge!(xml_fields, models)
    render_ext_js(&amp;#8216;ext_grid&amp;#8217;, options)
    render_ext_js(&amp;#8216;news_fun&amp;#8217;, options) if newsFun
  end  &lt;/p&gt;


	&lt;pre&gt;&lt;code&gt;def render_ext_js(name, options)
  javascript_tag(render(:partial =&amp;gt; "shared/ext_grid", :locals =&amp;gt; options))
end&lt;/code&gt;&lt;/pre&gt;


	&lt;p&gt;games/index.rhtml&lt;br /&gt;&lt;del&gt;&amp;#8212;&lt;/del&gt;-&lt;del&gt;&amp;#8212;&lt;/del&gt;-&lt;del&gt;&amp;#8212;&lt;/del&gt;-&lt;/p&gt;


	&lt;p&gt;&amp;lt;&lt;span&gt;= ext_layout(&amp;#8216;Games&amp;#8217;) %&amp;gt;&lt;br /&gt;&amp;lt;&lt;/span&gt;= ext_grid(:optons =&amp;gt; {:model =&amp;gt; &amp;#8220;game&amp;#8221;, :primary_key =&amp;gt; &amp;#8220;GameID&amp;#8221;, :fields =&amp;gt; %w(Title Console),
  :columns =&amp;gt; &amp;#8220;{header: &amp;#8216;Title&amp;#8217;, width: 300, dataIndex: &amp;#8216;Title&amp;#8217;}, {header: &amp;#8216;Console&amp;#8217;, width: 250, dataIndex: &amp;#8216;Console&amp;#8217;}&amp;#8221;, :height =&amp;gt; 340, :width =&amp;gt; 530, :pageSize =&amp;gt; 13}) %&amp;gt;&lt;/p&gt;


	&lt;p&gt;shared/_ext_grid.rhtml&lt;br /&gt;&lt;del&gt;&amp;#8212;&lt;/del&gt;-&lt;del&gt;&amp;#8212;&lt;/del&gt;-&lt;del&gt;&amp;#8212;&lt;/del&gt;-&lt;del&gt;-&lt;/del&gt;&lt;br /&gt;var pageGrid = function() {
    var grid; 
    var dialog; 
    var ds;&lt;/p&gt;


	&lt;pre&gt;&lt;code&gt;return { 
    init : function(){
         ds = new Ext.data.Store({    
         proxy: new Ext.data.HttpProxy({
            method: 'GET', 
            url: '&amp;lt;%= models %&amp;gt;.json'}),
            reader: new Ext.data.JsonReader({
                root: '&amp;lt;%= models %&amp;gt;',
                 totalProperty: 'totalCount',
                 id: '&amp;lt;%= primary_key %&amp;gt;'
            }, 
}&lt;br /&gt;}();&lt;/code&gt;&lt;/pre&gt;
	&lt;pre&gt;&lt;code&gt;});    &lt;/code&gt;&lt;/pre&gt;


	&lt;pre&gt;&lt;code&gt;var cm = new Ext.grid.ColumnModel([&amp;lt;%= columns %&amp;gt;]);
cm.defaultSortable = true;
grid = new Ext.grid.Grid(
    'content', 
    { ds: ds, cm: cm }
);    
grid.render();&lt;/code&gt;&lt;/pre&gt;


	&lt;pre&gt;&lt;code&gt;var gridFoot = grid.getView().getFooterPanel(true);
var paging = new Ext.PagingToolbar(gridFoot, ds, {
    pageSize: &amp;lt;%= pageSize %&amp;gt;,
    displayInfo: true,
    displayMsg: 'Displaying topics {0} - {1} of {2}',    
    emptyMsg: 'No topics to display'
});
ds.load({
    params:{start:0, limit:&amp;lt;%= pageSize %&amp;gt;}
});&lt;/code&gt;&lt;/pre&gt;


	&lt;pre&gt;&lt;code&gt;grid.on('rowdblclick', editResource);&lt;/code&gt;&lt;/pre&gt;


	&lt;pre&gt;&lt;code&gt;var gridHead = grid.getView().getHeaderPanel(true);
var tb = new Ext.Toolbar(gridHead);
tb.add(
    { 
        text: 'Create New &amp;lt;%= model %&amp;gt;', 
        handler: createResource 
    }, 
    '-', 
    { 
        text: 'Delete Selected  &amp;lt;%= model %&amp;gt;', 
        handler: deleteResource 
    }
);
tb.add(
    '-', 
    'Filter: ', 
    "&amp;lt;input type="text" id="text_filter"&gt;" 
);
Ext.get('text_filter').on('keyup', filterResource);&lt;/code&gt;&lt;/pre&gt;


	&lt;pre&gt;&lt;code&gt;}&lt;/code&gt;&lt;/pre&gt;


	&lt;p&gt;PageGrid.filterResource = function() {
    filtervalue = Ext.get(&amp;#8216;text_filter&amp;#8217;).dom.value;
    ds.proxy = new Ext.data.HttpProxy({
        method: &amp;#8216;GET&amp;#8217;, 
        url: &amp;#8216;&amp;lt;%= models %&amp;gt;.json?search=&amp;#8217; + filtervalue}
    );
    ds.reload();&lt;br /&gt;}&lt;/p&gt;


	&lt;p&gt;PageGrid.deleteResource = function() {
    var id = grid.getSelectionModel().getSelected(); 
    if(id){
        Ext.MessageBox.confirm(&amp;#8216;Confirm&amp;#8217;, &amp;#8216;Are you sure you want to delete this &amp;lt;%= model %&amp;gt;?&amp;#8217;, postDelete);
    } else {
        Ext.MessageBox.alert(&amp;#8216;DOH!&amp;#8217;, &amp;#8216;Maybe you want to try again after &lt;span class="caps"&gt;ACTUALLY&lt;/span&gt; selecting something?&amp;#8217;)
    }&lt;br /&gt;}&lt;/p&gt;


	&lt;p&gt;PageGrid.submitResource = function(){
    document.create_resource.submit();&lt;br /&gt;}&lt;/p&gt;


	&lt;p&gt;PageGrid.postDelete = function(btn){
    if(btn == &amp;#8216;yes&amp;#8217;) {
        var id = grid.getSelectionModel().getSelected();
        var deleteme = id.get(&amp;#8216;&amp;lt;%= primary_key %&amp;gt;&amp;#8216;);
        window.location.href = &amp;#8217;/&amp;lt;%= models %&amp;gt;/destroy/&amp;#8217; + deleteme;
    }&lt;br /&gt;}&lt;/p&gt;


	&lt;p&gt;PageGrid.editResource = function (grid, rowIndex) {
    var id = grid.getSelectionModel().getSelected();
    if(id) { 
        window.location.href = &amp;#8217;/&amp;lt;&lt;span&gt;= models %&amp;gt;/&amp;#8217; + id.get(&amp;#8216;&amp;lt;&lt;/span&gt;= primary_key %&amp;gt;&amp;#8216;); 
    }&lt;br /&gt;}&lt;br /&gt;// width:500, 630, pageSize:13, 20&lt;br /&gt;PageGrid.createResource = function() {
    if(!dialog) {
        dialog = new Ext.BasicDialog(&amp;#8216;newDialog&amp;#8217;, {
            width: &amp;lt;%= width %&amp;gt;, 
            height:&amp;lt;%= height %&amp;gt;, 
            shadow:true, 
            minWidth:300, 
            minHeight:&amp;lt;%= height %&amp;gt;, 
            proxyDrag:true, 
            autoScroll:false, 
            animEl:true 
        });
        dialog.addKeyListener(27, dialog.hide, dialog);
        postBtn = dialog.addButton(&amp;#8216;Submit&amp;#8217;, submitResource, this);
        dialog.addButton(&amp;#8216;Close&amp;#8217;, dialog.hide, dialog); 
    }
    dialog.show();
    dialog.on(&amp;#8216;hide&amp;#8217;, function(){
        document.create_resource.reset();
    })    &lt;br /&gt;}&lt;/p&gt;


	&lt;p&gt;Ext.onReady(pageGrid.init, pageGrid, true);&lt;/p&gt;


	&lt;p&gt;shared/_news_fun.rhtml&lt;br /&gt;&lt;del&gt;&amp;#8212;&lt;/del&gt;-&lt;del&gt;&amp;#8212;&lt;/del&gt;-&lt;del&gt;&amp;#8212;&lt;/del&gt;-&lt;del&gt;&amp;#8212;&lt;/del&gt;&lt;/p&gt;


	&lt;p&gt;PageGrid.renderNews = function(value, p, record) {
    return String.format(&amp;#8216;&lt;b&gt;{0}&lt;/b&gt;&lt;br /&gt;{1}&amp;#8217;, value, Ext.util.Format.stripTags(record.data[&amp;#8216;Body&amp;#8217;]).substr(0,100) + &amp;#8221;....&amp;#8221;);&lt;br /&gt;}&lt;/p&gt;


	&lt;p&gt;PageGrid.renderNewsPlain = function(value) {
       return String.format(&amp;#8216;&lt;b&gt;&lt;i&gt;{0}&lt;/i&gt;&lt;/b&gt;&amp;#8217;, value); &lt;br /&gt;}&lt;/p&gt;


	&lt;p&gt;PageGrid.toggleNews = function(btn, pressed) {
    cm.getColumnById(&amp;#8216;Headline&amp;#8217;).renderer = pressed ? renderNews : renderNewsPlain;
    grid.getView().refresh(); &lt;br /&gt;}&lt;/p&gt;


	&lt;p&gt;var formatBoolean = function (value) {
    return (value == 1) ? &amp;#8216;Yes&amp;#8217; : &amp;#8216;&lt;b class="\"alert\""&gt;IMO&lt;/span&gt;. I will see where I get from here&amp;#8230;&lt;/p&gt;</body-html>
    <created-at type="datetime">2009-08-04T17:04:57Z</created-at>
    <forum-id type="integer">8</forum-id>
    <id type="integer">471</id>
    <topic-id type="integer">118</topic-id>
    <updated-at type="datetime">2009-08-04T17:04:57Z</updated-at>
    <user-id type="integer">187</user-id>
  </post>
  <post>
    <body>Crap - I got so swamped at work that I completely forgot about this problem.  So my apologies to Mongo for not looking into this.

If GruffDavies is correct and it's simply a matter of the named route helpers that are generated are incorrect that would make sense. This book was written using Rails 1.2.6, and there were some minor changes to those routes in the early 2.x days.  One of which was the automatic pre-fixing of nested routes with the parent routes name. 

And Gruff - yes you should be able to use the shorthand version of :has_many in route generation now as well (also added to Rails after the book was published). You can use the shortcut has_one to link to a singular nested resource and a has_many to link to a collection nested resource. (However - I will note that I rarely see this idiom used).  As for why it wasn't working for you - I think you're missing a comma between :workouts and :has_many.

Hope that helps - once again sorry for forgetting about this.</body>
    <body-html>&lt;p&gt;Crap &amp;#8211; I got so swamped at work that I completely forgot about this problem.  So my apologies to Mongo for not looking into this.&lt;/p&gt;


	&lt;p&gt;If GruffDavies is correct and it&amp;#8217;s simply a matter of the named route helpers that are generated are incorrect that would make sense. This book was written using Rails 1.2.6, and there were some minor changes to those routes in the early 2.x days.  One of which was the automatic pre-fixing of nested routes with the parent routes name.&lt;/p&gt;


	&lt;p&gt;And Gruff &amp;#8211; yes you should be able to use the shorthand version of :has_many in route generation now as well (also added to Rails after the book was published). You can use the shortcut has_one to link to a singular nested resource and a has_many to link to a collection nested resource. (However &amp;#8211; I will note that I rarely see this idiom used).  As for why it wasn&amp;#8217;t working for you &amp;#8211; I think you&amp;#8217;re missing a comma between :workouts and :has_many.&lt;/p&gt;


	&lt;p&gt;Hope that helps &amp;#8211; once again sorry for forgetting about this.&lt;/p&gt;</body-html>
    <created-at type="datetime">2009-07-24T23:10:15Z</created-at>
    <forum-id type="integer">4</forum-id>
    <id type="integer">470</id>
    <topic-id type="integer">116</topic-id>
    <updated-at type="datetime">2009-07-24T23:10:15Z</updated-at>
    <user-id type="integer">1</user-id>
  </post>
  <post>
    <body>No, it seems I lied about the routes thing.  Read it somewhere, maybe it's an edge rails thing.</body>
    <body-html>&lt;p&gt;No, it seems I lied about the routes thing.  Read it somewhere, maybe it&amp;#8217;s an edge rails thing.&lt;/p&gt;</body-html>
    <created-at type="datetime">2009-07-24T16:34:24Z</created-at>
    <forum-id type="integer">4</forum-id>
    <id type="integer">469</id>
    <topic-id type="integer">116</topic-id>
    <updated-at type="datetime">2009-07-24T16:34:24Z</updated-at>
    <user-id type="integer">186</user-id>
  </post>
  <post>
    <body>I think you can also use a more concise method on config/routes.rb to map subordinate routes like this:
&lt;pre&gt;
map.resources :workouts :has_many =&gt; :activities
&lt;/pre&gt;
instead of 
&lt;pre&gt;
map.resources :workouts do |workout|
  workout.resources :activities
end
&lt;/pre&gt;</body>
    <body-html>&lt;p&gt;I think you can also use a more concise method on config/routes.rb to map subordinate routes like this:&lt;br /&gt;&lt;pre&gt;
map.resources :workouts :has_many =&amp;gt; :activities
&lt;/pre&gt;&lt;br /&gt;instead of &lt;br /&gt;&lt;pre&gt;
map.resources :workouts do |workout|
  workout.resources :activities
end
&lt;/pre&gt;&lt;/p&gt;</body-html>
    <created-at type="datetime">2009-07-24T16:31:46Z</created-at>
    <forum-id type="integer">4</forum-id>
    <id type="integer">468</id>
    <topic-id type="integer">116</topic-id>
    <updated-at type="datetime">2009-07-24T16:31:46Z</updated-at>
    <user-id type="integer">186</user-id>
  </post>
  <post>
    <body>and change the workout show view to look like:
&lt;pre&gt;
&lt;h1&gt;&lt;%= h @workout.label %&gt; Workout on &lt;%= h @workout.date.to_s(:long) %&gt; &lt;/h1&gt; 
&lt;table&gt;
   &lt;tr&gt;&lt;th&gt;Exercise&lt;/th&gt;&lt;th&gt;Reps&lt;/th&gt;&lt;th&gt;Resistance&lt;/th&gt;&lt;/tr&gt;
   &lt;%= render :partial =&gt; 'activities/activity', :collection =&gt; @activities %&gt; 
&lt;/table&gt; 

&lt;h3&gt;Add Exercise to this Workout&lt;/h3&gt; 
&lt;% form_for(:activity, :url =&gt; workout_activities_path(@workout)) do |f| %&gt;
   &lt;%= render :partial =&gt; 'activities/form', :locals =&gt; {:f =&gt; f} %&gt; 
&lt;% end %&gt; 

&lt;%= link_to 'Back', workouts_path %&gt;

&lt;/pre&gt;</body>
    <body-html>&lt;p&gt;and change the workout show view to look like:&lt;br /&gt;&lt;pre&gt;
&amp;lt;h1&amp;gt;&amp;lt;%= h @workout.label %&amp;gt; Workout on &amp;lt;%= h @workout.date.to_s(:long) %&amp;gt; &amp;lt;/h1&amp;gt; 
&amp;lt;table&amp;gt;
   &amp;lt;tr&amp;gt;&amp;lt;th&amp;gt;Exercise&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Reps&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Resistance&amp;lt;/th&amp;gt;&amp;lt;/tr&amp;gt;
   &amp;lt;%= render :partial =&amp;gt; 'activities/activity', :collection =&amp;gt; @activities %&amp;gt; 
&amp;lt;/table&amp;gt; 

&amp;lt;h3&amp;gt;Add Exercise to this Workout&amp;lt;/h3&amp;gt; 
&amp;lt;% form_for(:activity, :url =&amp;gt; workout_activities_path(@workout)) do |f| %&amp;gt;
   &amp;lt;%= render :partial =&amp;gt; 'activities/form', :locals =&amp;gt; {:f =&amp;gt; f} %&amp;gt; 
&amp;lt;% end %&amp;gt; 

&amp;lt;%= link_to 'Back', workouts_path %&amp;gt;

&lt;/pre&gt;&lt;/p&gt;</body-html>
    <created-at type="datetime">2009-07-24T16:29:50Z</created-at>
    <forum-id type="integer">4</forum-id>
    <id type="integer">467</id>
    <topic-id type="integer">116</topic-id>
    <updated-at type="datetime">2009-07-24T16:29:50Z</updated-at>
    <user-id type="integer">186</user-id>
  </post>
  <post>
    <body>There are two file changes needed to get it to work.

1. change the _activity partial to look like:
&lt;pre&gt;
&lt;tr&gt; 
  &lt;td&gt;&lt;%= activity.exercise.name %&gt;&lt;/td&gt; 
  &lt;td&gt;&lt;%= activity.repetitions %&gt;&lt;/td&gt; 
  &lt;td&gt;&lt;%= activity.resistance %&gt;&lt;/td&gt; 
  &lt;td&gt;&lt;%=link_to image_tag("edit_photo.gif", {:title =&gt; "Edit Exercise"}), edit_workout_activity_path(@workout, activity) %&gt;&lt;/td&gt; 
  &lt;td&gt;&lt;%= link_to image_tag("delete_photo.gif", {:title =&gt; "Delete Exercise"}), workout_activity_path(@workout, activity), 
                                                 :confirm =&gt; 'Are you sure?', 
                                                 :method =&gt; :delete %&gt; &lt;/td&gt; 
&lt;/tr&gt; 

&lt;/pre&gt;</body>
    <body-html>&lt;p&gt;There are two file changes needed to get it to work.&lt;/p&gt;


	&lt;p&gt;1. change the _activity partial to look like:&lt;br /&gt;&lt;pre&gt;
&amp;lt;tr&amp;gt; 
  &amp;lt;td&amp;gt;&amp;lt;%= activity.exercise.name %&amp;gt;&amp;lt;/td&amp;gt; 
  &amp;lt;td&amp;gt;&amp;lt;%= activity.repetitions %&amp;gt;&amp;lt;/td&amp;gt; 
  &amp;lt;td&amp;gt;&amp;lt;%= activity.resistance %&amp;gt;&amp;lt;/td&amp;gt; 
  &amp;lt;td&amp;gt;&amp;lt;%=link_to image_tag("edit_photo.gif", {:title =&amp;gt; "Edit Exercise"}), edit_workout_activity_path(@workout, activity) %&amp;gt;&amp;lt;/td&amp;gt; 
  &amp;lt;td&amp;gt;&amp;lt;%= link_to image_tag("delete_photo.gif", {:title =&amp;gt; "Delete Exercise"}), workout_activity_path(@workout, activity), 
                                                 :confirm =&amp;gt; 'Are you sure?', 
                                                 :method =&amp;gt; :delete %&amp;gt; &amp;lt;/td&amp;gt; 
&amp;lt;/tr&amp;gt; 

&lt;/pre&gt;&lt;/p&gt;</body-html>
    <created-at type="datetime">2009-07-24T16:29:08Z</created-at>
    <forum-id type="integer">4</forum-id>
    <id type="integer">466</id>
    <topic-id type="integer">116</topic-id>
    <updated-at type="datetime">2009-07-24T16:29:08Z</updated-at>
    <user-id type="integer">186</user-id>
  </post>
  <post>
    <body>Sorry, my post got munged as I didn't escape my code samples.</body>
    <body-html>&lt;p&gt;Sorry, my post got munged as I didn&amp;#8217;t escape my code samples.&lt;/p&gt;</body-html>
    <created-at type="datetime">2009-07-24T16:24:48Z</created-at>
    <forum-id type="integer">4</forum-id>
    <id type="integer">465</id>
    <topic-id type="integer">116</topic-id>
    <updated-at type="datetime">2009-07-24T16:24:48Z</updated-at>
    <user-id type="integer">186</user-id>
  </post>
  <post>
    <body>I fixed it.  The tutorial code is wrong in several places.  If you run "rake routes" you can inspect the routes created and also the named path helpers.  The code is specifying the wrong helpers in a few places.

1.  In the the app/views/show.html.erb the :url should be "workout_activities_path(@workout) not activities_path(@workout). 
2. The _activity partial should use edit_workout_activity_path(@workout, activity) for edit and workout_activity_path(@workout, activity) for delete.

There are other errors in the source code supplied too, such as missing ":" before "method" in various places so beware.  I don't think the source code was checked to see if it would run, or if it was then who knows what's going on.

HTH

Gruff</body>
    <body-html>&lt;p&gt;I fixed it.  The tutorial code is wrong in several places.  If you run &amp;#8220;rake routes&amp;#8221; you can inspect the routes created and also the named path helpers.  The code is specifying the wrong helpers in a few places.&lt;/p&gt;


	&lt;p&gt;1.  In the the app/views/show.html.erb the :url should be &lt;a href=""&gt;HTH&lt;/span&gt;&lt;/p&gt;


	&lt;p&gt;Gruff&lt;/p&gt;</body-html>
    <created-at type="datetime">2009-07-24T16:23:29Z</created-at>
    <forum-id type="integer">4</forum-id>
    <id type="integer">464</id>
    <topic-id type="integer">116</topic-id>
    <updated-at type="datetime">2009-07-24T16:23:29Z</updated-at>
    <user-id type="integer">186</user-id>
  </post>
  <post>
    <body>I'm having exactly the same problem.  Any ideas?

Thanks

Gruff</body>
    <body-html>&lt;p&gt;I&amp;#8217;m having exactly the same problem.  Any ideas?&lt;/p&gt;


	&lt;p&gt;Thanks&lt;/p&gt;


	&lt;p&gt;Gruff&lt;/p&gt;</body-html>
    <created-at type="datetime">2009-07-24T12:46:55Z</created-at>
    <forum-id type="integer">4</forum-id>
    <id type="integer">463</id>
    <topic-id type="integer">116</topic-id>
    <updated-at type="datetime">2009-07-24T12:46:55Z</updated-at>
    <user-id type="integer">186</user-id>
  </post>
  <post>
    <body>Never mind, turns out I was using the wrong version of reset-fonts-grids.css

But you should still write an advanced rails book :)</body>
    <body-html>&lt;p&gt;Never mind, turns out I was using the wrong version of reset-fonts-grids.css&lt;/p&gt;


	&lt;p&gt;But you should still write an advanced rails book :)&lt;/p&gt;</body-html>
    <created-at type="datetime">2009-07-02T04:17:19Z</created-at>
    <forum-id type="integer">3</forum-id>
    <id type="integer">462</id>
    <topic-id type="integer">117</topic-id>
    <updated-at type="datetime">2009-07-02T04:17:19Z</updated-at>
    <user-id type="integer">184</user-id>
  </post>
  <post>
    <body>Hey Eldon,

I just finished your other book, Foundation Rails 2, and now I'm reading this one. Great book!

Anyways, the site layout isn't working properly in Safari 4 (10.5.7). Just downloaded the source files from Apress' website and made application.rhtml and index.rhtml. When I added index.rhtml, the site navigation bar dissapears. The html is there in the source, but its not showing up. Any ideas? Known bug?

Thanks!

P.S. You should write an advanced rails book.</body>
    <body-html>&lt;p&gt;Hey Eldon,&lt;/p&gt;


	&lt;p&gt;I just finished your other book, Foundation Rails 2, and now I&amp;#8217;m reading this one. Great book!&lt;/p&gt;


	&lt;p&gt;Anyways, the site layout isn&amp;#8217;t working properly in Safari 4 (10.5.7). Just downloaded the source files from Apress&amp;#8217; website and made application.rhtml and index.rhtml. When I added index.rhtml, the site navigation bar dissapears. The html is there in the source, but its not showing up. Any ideas? Known bug?&lt;/p&gt;


	&lt;p&gt;Thanks!&lt;/p&gt;


	&lt;p&gt;P.S. You should write an advanced rails book.&lt;/p&gt;</body-html>
    <created-at type="datetime">2009-07-02T02:04:36Z</created-at>
    <forum-id type="integer">3</forum-id>
    <id type="integer">461</id>
    <topic-id type="integer">117</topic-id>
    <updated-at type="datetime">2009-07-02T02:04:53Z</updated-at>
    <user-id type="integer">184</user-id>
  </post>
  <post>
    <body>Sorry.  It was a copy and paste typo in my response to the original post.  I have since edited my post.</body>
    <body-html>&lt;p&gt;Sorry.  It was a copy and paste typo in my response to the original post.  I have since edited my post.&lt;/p&gt;</body-html>
    <created-at type="datetime">2009-06-25T22:05:08Z</created-at>
    <forum-id type="integer">3</forum-id>
    <id type="integer">460</id>
    <topic-id type="integer">113</topic-id>
    <updated-at type="datetime">2009-06-25T22:05:08Z</updated-at>
    <user-id type="integer">183</user-id>
  </post>
  <post>
    <body>Eldon,

Thank you so much for taking the time to look at this, and the most helpful book.  Tell your publisher there is an increasing demand for an updated version...

I have zipped up the exercisr directory and emailed it to an alameda eldon gmail account.  I'm using mysql, so no db is included in the file.

Please don't spend a whole lot of time looking at this, as me struggling to figure it out is all part of the learning experience.  I do appreciate any tips or pointers in the general direction to look.

If I understand the concepts correctly, things like workout_id are automatically generated and set up based upon the relationships defined in the models of the related objects.  In this case between an activity and a workout.  I'm sure its something simple.</body>
    <body-html>&lt;p&gt;Eldon,&lt;/p&gt;


	&lt;p&gt;Thank you so much for taking the time to look at this, and the most helpful book.  Tell your publisher there is an increasing demand for an updated version&amp;#8230;&lt;/p&gt;


	&lt;p&gt;I have zipped up the exercisr directory and emailed it to an alameda eldon gmail account.  I&amp;#8217;m using mysql, so no db is included in the file.&lt;/p&gt;


	&lt;p&gt;Please don&amp;#8217;t spend a whole lot of time looking at this, as me struggling to figure it out is all part of the learning experience.  I do appreciate any tips or pointers in the general direction to look.&lt;/p&gt;


	&lt;p&gt;If I understand the concepts correctly, things like workout_id are automatically generated and set up based upon the relationships defined in the models of the related objects.  In this case between an activity and a workout.  I&amp;#8217;m sure its something simple.&lt;/p&gt;</body-html>
    <created-at type="datetime">2009-06-24T22:52:14Z</created-at>
    <forum-id type="integer">4</forum-id>
    <id type="integer">459</id>
    <topic-id type="integer">116</topic-id>
    <updated-at type="datetime">2009-06-24T22:52:14Z</updated-at>
    <user-id type="integer">183</user-id>
  </post>
  <post>
    <body>Were you able to get this working? I'm not seeing the difference in the two lines of code that you posted.</body>
    <body-html>&lt;p&gt;Were you able to get this working? I&amp;#8217;m not seeing the difference in the two lines of code that you posted.&lt;/p&gt;</body-html>
    <created-at type="datetime">2009-06-24T16:25:03Z</created-at>
    <forum-id type="integer">3</forum-id>
    <id type="integer">458</id>
    <topic-id type="integer">113</topic-id>
    <updated-at type="datetime">2009-06-24T16:25:03Z</updated-at>
    <user-id type="integer">1</user-id>
  </post>
  <post>
    <body>Yeah - unfortunately it doesn't seem like the writer of the blog continued it. Too bad it was a fun idea.</body>
    <body-html>&lt;p&gt;Yeah &amp;#8211; unfortunately it doesn&amp;#8217;t seem like the writer of the blog continued it. Too bad it was a fun idea.&lt;/p&gt;</body-html>
    <created-at type="datetime">2009-06-24T16:24:42Z</created-at>
    <forum-id type="integer">10</forum-id>
    <id type="integer">457</id>
    <topic-id type="integer">81</topic-id>
    <updated-at type="datetime">2009-06-24T16:24:53Z</updated-at>
    <user-id type="integer">1</user-id>
  </post>
</posts>
