<?xml version="1.0" encoding="utf-8" ?>
<rss version="2.0">
<channel>
	<title>Learning Rails Book Forum</title>
	<description><![CDATA[O'Reilly's Learning Rails Book Forum]]></description>
	<link>http://forums.oreilly.com/index.php</link>
	<pubDate>Fri, 20 Nov 2009 19:02:14 -0500</pubDate>
	<ttl>120</ttl>
	<item>
		<title>Activerecord Find</title>
		<link>http://forums.oreilly.com/index.php?showtopic=5457</link>
		<description><![CDATA[Learning Rails: I have used this book to build my working model (very helpful). <br />I have had a problem for awhile trying to find/match a referral remail address (unique) with a profile pemail address(unique). Then rendering the profile page based on the find. I'm using the default parms.id method. Also created an index on pemail in the profile data base. Just can’t get it to work.  <br />Can anyone recomment my next book that can explain a srting search/find (soup to nuts)?<br />Class Profile &lt; ActiveRecord::Base<br />  has_many :referrals, :dependent =&gt; :destroy<br />Class Referral &lt; ActiveRecord::Base<br />  has_and_belongs_to_many :profile<br />]]></description>
		<pubDate>Sun, 18 Oct 2009 08:45:25 -0400</pubDate>
		<guid>http://forums.oreilly.com/index.php?showtopic=5457</guid>
	</item>
	<item>
		<title>Helpers, Form Builders, Names</title>
		<link>http://forums.oreilly.com/index.php?showtopic=5249</link>
		<description><![CDATA[I'm plowing through Chapter 8 trying to define my own helper methods, and I'm getting some questions:<br /> - what is the difference between a helper and a form builder? I see there's a people_helper.rb which contains a module PeopleHelper with nothing in it.<br /> The book around pg 134 starts adding stuff to form builder files. After playing around trying to define my own methods, I find that there seems to be a naming rule:<br />- the :builder references a name like AxxxBxxx for the form builder<br /> - the file name has to be in the form axxx_bxxx.rb<br /> - the class name has to be in the form AxxxBxxx<br /><br />So, on pg 135 where it says that Rails will know to look for /app/helpers/TidyFormBuilder, this actually means that it looks for class TidyFormBuilder in the file<br /> /app/helpers/tidy_form_builder.rb<br /><br />Is that correct?<br /><br />T.]]></description>
		<pubDate>Sun, 06 Sep 2009 17:53:22 -0400</pubDate>
		<guid>http://forums.oreilly.com/index.php?showtopic=5249</guid>
	</item>
	<item>
		<title>Chapter 9 Developing Model Relationships</title>
		<link>http://forums.oreilly.com/index.php?showtopic=5099</link>
		<description><![CDATA[Hi Guys,<br /><br />I am hoping someone is able to help me, I have been following this book through and I have only now ran into something i can solve myself from the errata, <br /><br />I am getting a NoMethodError when i try to add a new course for student, or view the coruses.html.erb file, I have been over all the coding in courses, courses.controller, students.controller etc and i can't figure out the issue and its driving me nuts, does anyone have a clue?<br /><br />NoMethodError in Students#courses<br /><br />Showing app/views/students/courses.html.erb where line #1 raised:<br /><br />You have a nil object when you didn't expect it!<br />The error occurred while evaluating nil.name<br /><br />Extracted source (around line #1):<br /><br />1: &lt;h1&gt;&lt;%= @student.name %&gt;'s Courses&lt;/h1&gt;<br />2: <br />3: &lt;% if @courses.length &gt; 0 %&gt;<br />4:   &lt;% form_tag(course_remove_student_path(@student)) do %&gt;<div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'>&lt;h1&gt;&lt;%= @student.name %&gt;'s Courses&lt;/h1&gt;<br /><br />&lt;% if @courses.length &gt; 0 %&gt;<br />  &lt;% form_tag(course_remove_student_path(@student)) do %&gt;<br />    &lt;table&gt;<br />      &lt;tr&gt;<br />        &lt;th&gt;Course&lt;/th&gt;<br />        &lt;th&gt;Remove?&lt;/th&gt;<br />      &lt;/tr&gt;<br />&lt;% for course in @courses do %&gt;<br />  &lt;tr&gt;<br />    &lt;td&gt;&lt;%=h course.name %&gt;&lt;/td&gt;<br />    &lt;td&gt;&lt;%= check_box_tag "course[]", course.id %&gt;&lt;/td&gt;<br />  &lt;/tr&gt;<br />&lt;% end %&gt;<br />&lt;/table&gt;<br />&lt;br /&gt;<br />&lt;%= submit_tag "Remove checked courses" %&gt;<br />&lt;% end %&gt;<br />&lt;% else %&gt;<br />&lt;p&gt;Not enrolled in any courses yet.&lt;/p&gt;<br />&lt;% end %&gt;<br /><br />&lt;h2&gt; Enroll in new course&lt;/h2&gt;<br /><br />&lt;% if @student.courses.count &lt; Course.count then %&gt;<br />  &lt;% form_tag(course_add_student_path(@student)) do %&gt;<br />    &lt;%= select_tag(:course, options_from_collection_for_select(@student.unenrolled_courses, :id, :anem)) %&gt;<br />    &lt;%= submit_tag 'Enroll' %&gt;<br />    &lt;% end %&gt;<br />    &lt;% else %&gt;<br />    &lt;p&gt;&lt;%=h @student.name %&gt; is enrolled in every course. &lt;/p&gt;<br />    &lt;% end %&gt;<br /><br />&lt;p&gt;&lt;%= link_to "back", @students %&gt;&lt;/p&gt;</div><br /><br /><div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'><div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'>class Course &lt; ActiveRecord::Base<br />  has_and_belongs_to_many :students<br />  <br />  def enrolled_in?(course)<br />    self.courses.include?(course)<br />  end<br />  <br />  def unenrolled_courses<br />    Course.find(:all) - self.courses<br />  end<br />  <br />end<br /></div></div><br /><br /><div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'>class Student &lt; ActiveRecord::Base<br />  has_many :awards, :dependent =&gt; :destroy<br />  has_and_belongs_to_many :courses<br />  <br />  def name<br />    given_name + " " + family_name<br />  end<br />end<br /></div><br /><br /><div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'>class CoursesController &lt; ApplicationController<br />  # GET /courses<br />  # GET /courses.xml<br />  def index<br />    @courses = Course.all<br /><br />    respond_to do |format|<br />      format.html # index.html.erb<br />      format.xml  { render :xml =&gt; @courses }<br />    end<br />  end<br /><br />  # GET /courses/1<br />  # GET /courses/1.xml<br />  def show<br />    @course = Course.find(params[:id])<br /><br />    respond_to do |format|<br />      format.html # show.html.erb<br />      format.xml  { render :xml =&gt; @course }<br />    end<br />  end<br /><br />  # GET /courses/new<br />  # GET /courses/new.xml<br />  def new<br />    @course = Course.new<br /><br />    respond_to do |format|<br />      format.html # new.html.erb<br />      format.xml  { render :xml =&gt; @course }<br />    end<br />  end<br /><br />  # GET /courses/1/edit<br />  def edit<br />    @course = Course.find(params[:id])<br />  end<br /><br />  # POST /courses<br />  # POST /courses.xml<br />  def create<br />    @course = Course.new(params[:course])<br /><br />    respond_to do |format|<br />      if @course.save<br />        flash[:notice] = 'Course was successfully created.'<br />        format.html { redirect_to(@course) }<br />        format.xml  { render :xml =&gt; @course, :status =&gt; :created, :location =&gt; @course }<br />      else<br />        format.html { render :action =&gt; "new" }<br />        format.xml  { render :xml =&gt; @course.errors, :status =&gt; :unprocessable_entity }<br />      end<br />    end<br />  end<br /><br />  # PUT /courses/1<br />  # PUT /courses/1.xml<br />  def update<br />    @course = Course.find(params[:id])<br /><br />    respond_to do |format|<br />      if @course.update_attributes(params[:course])<br />        flash[:notice] = 'Course was successfully updated.'<br />        format.html { redirect_to(@course) }<br />        format.xml  { head <img src="http://forums.oreilly.com/style_emoticons/default/ohmy.gif" style="vertical-align:middle" emoid=":o" border="0" alt="ohmy.gif" />k }<br />      else<br />        format.html { render :action =&gt; "edit" }<br />        format.xml  { render :xml =&gt; @course.errors, :status =&gt; :unprocessable_entity }<br />      end<br />    end<br />  end<br /><br />  # DELETE /courses/1<br />  # DELETE /courses/1.xml<br />  def destroy<br />    @course = Course.find(params[:id])<br />    @course.destroy<br /><br />    respond_to do |format|<br />      format.html { redirect_to(courses_url) }<br />      format.xml  { head <img src="http://forums.oreilly.com/style_emoticons/default/ohmy.gif" style="vertical-align:middle" emoid=":o" border="0" alt="ohmy.gif" />k }<br />    end<br />  end<br />  # GET /courses/1/roll<br />  def roll<br />    @course = Course.find(params[:id])<br />  end<br />  # GET /students/1/courses<br />  def courses<br />    @student = Student.find(params[:id])<br />    @course = @student.courses<br />  end<br />  # PSOT /students/1/course_add?course_id=2<br />  # (note no real query string, just convenient notation for parameters)<br />  <br />  def course_add<br />    #convert ids from routing to objects<br />    @student = Student.find(params[:id])<br />    @course = Course.find(params[:course])<br />    <br />    unless @student.enrolled_in?(@course)<br />      @student.courses &lt;&lt; @course<br />      flash[:notice] = 'Course was successfully added'<br />    else<br />        flash[:error] = 'Student was already enrolled'<br />    end <br />    redirect_to :action =&gt; :courses, :id =&gt; @student<br />  end<br />  <br />  def course_remove<br />    @student = Student.find(params[:id])<br />    course_ids = params[:courses]<br />    unless course_ids.blank?<br />      course_ids.each do |course_id|<br />        course = Course.find(course_id)<br />        if @student.enrolled_in?(course)  <br />          logger.info "Removing student from course #{course.id}"<br />          @student.courses.delete(course)<br />          flash[:notice] = 'Course was successfully deleted'<br />        end<br />      end<br />    redirect_to :action =&gt; :courses, :id =&gt; @student<br />end<br />end<br />end<br />  <br /></div><br /><br /><div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'>class StudentsController &lt; ApplicationController<br />  # GET /students<br />  # GET /students.xml<br />  def index<br />    @students = Student.all<br /><br />    respond_to do |format|<br />      format.html # index.html.erb<br />      format.xml  { render :xml =&gt; @students }<br />    end<br />  end<br /><br />  # GET /students/1<br />  # GET /students/1.xml<br />  def show<br />    @student = Student.find(params[:id])<br /><br />    respond_to do |format|<br />      format.html # show.html.erb<br />      format.xml  { render :xml =&gt; @student }<br />    end<br />  end<br /><br />  # GET /students/new<br />  # GET /students/new.xml<br />  def new<br />    @student = Student.new<br /><br />    respond_to do |format|<br />      format.html # new.html.erb<br />      format.xml  { render :xml =&gt; @student }<br />    end<br />  end<br /><br />  # GET /students/1/edit<br />  def edit<br />    @student = Student.find(params[:id])<br />  end<br /><br />  # POST /students<br />  # POST /students.xml<br />  def create<br />    @student = Student.new(params[:student])<br /><br />    respond_to do |format|<br />      if @student.save<br />        flash[:notice] = 'Student was successfully created.'<br />        format.html { redirect_to(@student) }<br />        format.xml  { render :xml =&gt; @student, :status =&gt; :created, :location =&gt; @student }<br />      else<br />        format.html { render :action =&gt; "new" }<br />        format.xml  { render :xml =&gt; @student.errors, :status =&gt; :unprocessable_entity }<br />      end<br />    end<br />  end<br /><br />  # PUT /students/1<br />  # PUT /students/1.xml<br />  def update<br />    @student = Student.find(params[:id])<br /><br />    respond_to do |format|<br />      if @student.update_attributes(params[:student])<br />        flash[:notice] = 'Student was successfully updated.'<br />        format.html { redirect_to(@student) }<br />        format.xml  { head <img src="http://forums.oreilly.com/style_emoticons/default/ohmy.gif" style="vertical-align:middle" emoid=":o" border="0" alt="ohmy.gif" />k }<br />      else<br />        format.html { render :action =&gt; "edit" }<br />        format.xml  { render :xml =&gt; @student.errors, :status =&gt; :unprocessable_entity }<br />      end<br />    end<br />  end<br /><br />  # DELETE /students/1<br />  # DELETE /students/1.xml<br />  def destroy<br />    @student = Student.find(params[:id])<br />    @student.destroy<br /><br />    respond_to do |format|<br />      format.html { redirect_to(students_url) }<br />      format.xml  { head <img src="http://forums.oreilly.com/style_emoticons/default/ohmy.gif" style="vertical-align:middle" emoid=":o" border="0" alt="ohmy.gif" />k }<br />    end<br />  end<br />end<br /></div>]]></description>
		<pubDate>Fri, 21 Aug 2009 04:21:45 -0400</pubDate>
		<guid>http://forums.oreilly.com/index.php?showtopic=5099</guid>
	</item>
	<item>
		<title>Actioncontroller::routingerror</title>
		<link>http://forums.oreilly.com/index.php?showtopic=4931</link>
		<description><![CDATA[hi, so after I've upgraded from rails 2.1.0 to 2.3.3 I keep getting this error:<br /><br />image_url failed to generate from {:controller=&gt;"images", :action=&gt;"show", :id=&gt;"remove.gif"}, expected: {:controller=&gt;"images", :action=&gt;"show"}, diff: {:id=&gt;"remove.gif"}<br />Extracted source (around line #202):<br /><br />199: 		<br />200: 		// remove column<br />201: 		var removelinkhover = "click to remove,&#092;n ⌘-click to remove all,&#092;noption-click to remove all reserved hosts"	<br />202: 		var remove_link = Builder.node( 'img', {src:"&lt;%=image_path "remove.gif"%&gt;",<br />203: 												title:removelinkhover,<br />204: 												style:"cursor:pointer"} )<br />205: 		remove_link.addEventListener('click', function( e ){ removeMachineFromReservationHandler( e, id ) } )<br /><br />I've tried to fix it for quite a long time and ran out of ideas. Any help would be appreciated!]]></description>
		<pubDate>Mon, 27 Jul 2009 22:04:22 -0400</pubDate>
		<guid>http://forums.oreilly.com/index.php?showtopic=4931</guid>
	</item>
	<item>
		<title>Chapter 8. Wrap_field Is Not Generating The Label Names.</title>
		<link>http://forums.oreilly.com/index.php?showtopic=4650</link>
		<description><![CDATA[I seem to be having issues at the end of chapter 8. I have doubled checked my code and all is good. Everything works except the labels just print label to the screen instead of their names name, email, etc.<br /><br />Here's my wrapping_tidy_form_builder class<br /><!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->class WrappingTidyFormBuilder &#60; ActionView&#58;&#58;Helpers&#58;&#58;FormBuilder<br />&nbsp;&nbsp;<br />&nbsp;&nbsp;def country_select&#40;method, options={}, html_options={}&#41;<br />&nbsp;&nbsp;&nbsp;&nbsp;select&#40;method, &#91;&#91;'Canada', 'Canada'&#93;,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#91;'Mexico', 'Mexico'&#93;,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#91;'United Kingdom', 'UK'&#93;,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#91;'United States of America', 'USA'&#93;&#93;,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;options, html_options&#41;<br />&nbsp;&nbsp;end<br />&nbsp;&nbsp;<br />&nbsp;&nbsp;<br />&nbsp;&nbsp;def text_field&#40;method, options={}&#41;<br />&nbsp;&nbsp;&nbsp;&nbsp;wrap_field&#40;label_for&#40;method, options&#41; + super&#40;method, options&#41;, options&#41;<br />&nbsp;&nbsp;end<br /><br />&nbsp;&nbsp;def text_area&#40;method, options={}&#41;<br />&nbsp;&nbsp;&nbsp;&nbsp;wrap_field&#40;label_for&#40;method, options&#41; + super&#40;method, options&#41;, options&#41;<br />&nbsp;&nbsp;end<br /><br />&nbsp;&nbsp;def password_field&#40;method, options={}&#41;<br />&nbsp;&nbsp;&nbsp;&nbsp;wrap_field&#40;label_for&#40;method, options&#41; + super&#40;method, options&#41;, options&#41;<br />&nbsp;&nbsp;end<br />&nbsp;&nbsp;<br />&nbsp;&nbsp;def file_field&#40;method, options={}&#41;<br />&nbsp;&nbsp;&nbsp;&nbsp;wrap_field&#40;label_for&#40;method, options&#41; + super&#40;method, options&#41;, options&#41;<br />&nbsp;&nbsp;end<br /><br />&nbsp;&nbsp;<br />&nbsp;&nbsp;def date_select&#40;method, options = {}, html_options = {}&#41;<br />&nbsp;&nbsp; wrap_field&#40;label_for&#40;method, options&#41; + super&#40;method, options, html_options&#41;, options&#41;<br />&nbsp;&nbsp;end<br />&nbsp;&nbsp;<br />&nbsp;&nbsp;def datetime_select&#40;method, options = {}, html_options = {}&#41;<br />&nbsp;&nbsp; wrap_field&#40;label_for&#40;method, options&#41; + super&#40;method, options, html_options&#41;, options&#41;<br />&nbsp;&nbsp;end<br />&nbsp;&nbsp;<br />&nbsp;&nbsp;def select&#40;method, choices, options = {}, html_options = {}&#41;<br />&nbsp;&nbsp;&nbsp;&nbsp;wrap_field&#40;label_for&#40;method, options&#41; + super&#40;method, choices, options, html_options&#41;, options&#41;<br />&nbsp;&nbsp;end<br /><br />&nbsp;&nbsp;def check_box&#40;method, options = {}, checked_value = &#34;1&#34;, unchecked_value = &#34;0&#34;&#41;<br />&nbsp;&nbsp;&nbsp;&nbsp;wrap_field&#40;label_for&#40;method, options&#41; + super&#40;method, options, checked_value, unchecked_value&#41;, options&#41;<br />&nbsp;&nbsp;end<br />&nbsp;&nbsp;<br />&nbsp;&nbsp;private<br />&nbsp;&nbsp;def label_for&#40;method, options={}&#41;<br />&nbsp;&nbsp;&nbsp;&nbsp;extra = &#34;&#34;<br />&nbsp;&nbsp;&nbsp;&nbsp;if options&#91;&#58;required&#93;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;extra = &#34; &#60;span class='required_mark'&#62;*&#60;/span&#62;&#34;<br />&nbsp;&nbsp;&nbsp;&nbsp;end<br />&nbsp;&nbsp;&nbsp;&nbsp;label&#40;&#58;label || method&#41; + extra + &#34;&#60;br /&#62;&#34;<br />&nbsp;&nbsp;end<br /><br />&nbsp;&nbsp;def wrap_field&#40;text, options={}&#41;<br />&nbsp;&nbsp;&nbsp;&nbsp;field_class = &#34;field&#34;<br />&nbsp;&nbsp;&nbsp;&nbsp;if options&#91;&#58;required&#93;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;field_class = &#34;field required&#34;<br />&nbsp;&nbsp;&nbsp;&nbsp;end<br />&nbsp;&nbsp;&nbsp;&nbsp;&#34;&#60;div class='#{field_class}'&#62;&#34; + text + &#34;&#60;/div&#62;&#34;<br />&nbsp;&nbsp;end<br />&nbsp;&nbsp;<br />end<!--c2--></div><!--ec2--><br /><br />And here is the form partial<br /><!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->&#60;%= error_messages_for &#58;person %&#62;<br /><br />&#60;% form_for&#40;&#58;person, @person,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#58;url =&#62; { &#58;action =&#62; &#40; @person.new_record? ? &#34;create&#34; &#58; &#34;update&#34; &#41; },<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#58;builder =&#62; WrappingTidyFormBuilder&#41; do |f| %&#62;<br /><br />&nbsp;&nbsp; <br /><br />&nbsp;&nbsp;&nbsp;&nbsp; &#60;%= f.text_field &#58;name, &#58;required =&#62; true %&#62;<br /><br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&#60;%= f.password_field &#58;secret, &#58;required =&#62; true %&#62;<br /><br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&#60;%= f.country_select &#58;country, &#58;required =&#62; true %&#62;<br /><br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&#60;%= f.text_field &#58;email, &#58;required =&#62; true %&#62;<br /><br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&#60;%= f.text_area &#58;description, &#58;rows =&#62; 10, &#58;cols =&#62; 30 %&#62;<br /><br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&#60;%= f.check_box &#58;can_send_email , &#58;required =&#62; true%&#62;<br /><br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&#60;%= f.text_field &#58;graduation_year %&#62;<br /><br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&#60;%= f.text_field &#58;body_temperature %&#62;<br /><br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&#60;%= f.text_field &#58;price %&#62;<br /><br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&#60;%= f.date_select &#58;birthday, &#58;required =&#62; true %&#62;<br /><br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&#60;%= f.datetime_select &#58;favorite_time, &#58;required =&#62; true %&#62;<br /><br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&#60;%= f.file_field &#58;photo %&#62;<br /><br /><br />&nbsp;&nbsp;&#60;p&#62;<br />&nbsp;&nbsp;&nbsp;&nbsp;&#60;%= f.submit &#34;Update&#34; %&#62;<br />&nbsp;&nbsp;&#60;/p&#62;<br />&#60;% end %&#62;<!--c2--></div><!--ec2--><br /><br />Any help is appreciated. Thanks.<br />-Scott]]></description>
		<pubDate>Sun, 28 Jun 2009 17:17:45 -0400</pubDate>
		<guid>http://forums.oreilly.com/index.php?showtopic=4650</guid>
	</item>
	<item>
		<title>Running Sample Code?</title>
		<link>http://forums.oreilly.com/index.php?showtopic=4503</link>
		<description><![CDATA[I admit it, I got lazy with the typing and let a few chapters slip by without actually keeping my local guestbook app caught up with the code samples. Now I'd like to run the code samples provided on this site, but I'm running into trouble.<br /><br />The first problem was my rails version number, as defined in environment.rb. I updated:<br /><br />"RAILS_GEM_VERSION = '2.0.2' unless defined? RAILS_GEM_VERSION"<br /><br />to:<br /><br />"RAILS_GEM_VERSION = '2.3.2' unless defined? RAILS_GEM_VERSION"<br /><br />Next, I had to change "controllers/application.rb" to controllers/application_controller.rb"<br /><br />Now I think I'm having trouble with migrations. I had a db table built from ~chapter 6 or so (now chapter 8), and I began by running "rake db:rollback" a few times. Then I ran "rake db:migrate" and tried to run the app. All's well and good, until I tried "new person." This throws an exception to the tune of:<br /><br />"ActionController::RoutingError in People#new<br /><br />Showing app/views/people/_form.html.erb where line #5 raised:<br /><br />person_url failed to generate from {:controller=&gt;"people", :action=&gt;"show", :id=&gt;#&lt;Person id: nil, name: nil, secret: nil, country: nil, email: nil, description: nil, can_send_email: nil, graduation_year: nil, body_temperature: nil, price: nil, birthday: nil, favorite_time: nil, created_at: nil, updated_at: nil, extension: nil&gt;}, expected: {:controller=&gt;"people", :action=&gt;"show"}, diff: {:id=&gt;#&lt;Person id: nil, name: nil, secret: nil, country: nil, email: nil, description: nil, can_send_email: nil, graduation_year: nil, body_temperature: nil, price: nil, birthday: nil, favorite_time: nil, created_at: nil, updated_at: nil, extension: nil&gt;}"<br /><br />What's my next move here? Or just yell at me for being lazy, that's cool too.]]></description>
		<pubDate>Fri, 12 Jun 2009 02:41:44 -0400</pubDate>
		<guid>http://forums.oreilly.com/index.php?showtopic=4503</guid>
	</item>
	<item>
		<title><![CDATA[I &lt;3 This Forum]]></title>
		<link>http://forums.oreilly.com/index.php?showtopic=4419</link>
		<description><![CDATA[I truly appreciate the work you're doing to maintain this forum. It's enhancing my experience with the book tremendously. Thank you Simon!]]></description>
		<pubDate>Wed, 03 Jun 2009 18:03:49 -0400</pubDate>
		<guid>http://forums.oreilly.com/index.php?showtopic=4419</guid>
	</item>
	<item>
		<title>Chapter 8; File Upload Form; Name Error</title>
		<link>http://forums.oreilly.com/index.php?showtopic=4398</link>
		<description><![CDATA[I'm very new to Rails, so please bear with me.<br /><br />I'm getting a name error when I try to look at my show view in my browser. I followed the book's instructions verbatim, I even included the change to the code on page 124 as noted in the errata. Any tips on what I may be doing wrong here?<br /><br />Here's the error that I'm getting:<br /><br /><div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'>undefined local variable or method &#96;extension' for #&lt;Theater:0x24fa2d4&gt;<br /><br />Extracted source (around line #4): <br /><br />&lt;table width="730" border="0" align="center" id="show_table"&gt;<br />2:   &lt;tr&gt;<br />3:     &lt;td rowspan="6" align="left" valign="top"&gt;<br />4: 	&lt;% if @theater.has_photo? %&gt;<br />5: 		&lt;%= image_tag @theater.photo_path %&gt;<br />6: 	&lt;% else %&gt;<br />7: 	No photo.<br /></div><br /><br />Note: "theater" is the name of the table that I'm inserting the extension column into; it takes the place of "person" in the book example.<br /><br />Also, I'm running Rails on a Mac and editing with Xcode, if that helps.<br /><br />Thanks very much!]]></description>
		<pubDate>Sun, 31 May 2009 02:23:21 -0400</pubDate>
		<guid>http://forums.oreilly.com/index.php?showtopic=4398</guid>
	</item>
	<item>
		<title>Country_select And The Label</title>
		<link>http://forums.oreilly.com/index.php?showtopic=4296</link>
		<description><![CDATA[The fourth paragraph on page 137 says "Remember how country_select calls the select method? It now calls the method that provides the label." To which method does that second sentence refer? Removing the "f.label" call from _form.html.erb results in no label on the country field.]]></description>
		<pubDate>Tue, 19 May 2009 11:25:00 -0400</pubDate>
		<guid>http://forums.oreilly.com/index.php?showtopic=4296</guid>
	</item>
	<item>
		<title>Ch 4 Page 52 Example Code Problem - Guest</title>
		<link>http://forums.oreilly.com/index.php?showtopic=4252</link>
		<description><![CDATA[When I run the browser, I get an error "uninitialized constant EntriesController::Entry" from the example line @entries = Entry.find(:all). See page 52 example 4.7]]></description>
		<pubDate>Thu, 14 May 2009 17:27:05 -0400</pubDate>
		<guid>http://forums.oreilly.com/index.php?showtopic=4252</guid>
	</item>
	<item>
		<title><![CDATA[Can't Run "hello"]]></title>
		<link>http://forums.oreilly.com/index.php?showtopic=4217</link>
		<description><![CDATA[Hi,<br /><br />I can't run the first hello program (chapter 2).<br /><br />I generated the hello index successfully, but when I went to localhost:3000/hello  I get the following error: <br /><br />We're sorry, but something went wrong.<br /><br />We've been notified about this issue and we'll take a look at it shortly.<br /><br /><br />I also tried all the previous steps (including a new install of ruby and rails) on another computer and got the same results.<br /><br />Thanks for any help.<br /><br /><br />]]></description>
		<pubDate>Mon, 11 May 2009 11:13:04 -0400</pubDate>
		<guid>http://forums.oreilly.com/index.php?showtopic=4217</guid>
	</item>
	<item>
		<title>Rails 1 Or Rails 2</title>
		<link>http://forums.oreilly.com/index.php?showtopic=4048</link>
		<description><![CDATA[Which version does this book cover? It doesn't mention anything in the description.]]></description>
		<pubDate>Mon, 20 Apr 2009 12:59:36 -0400</pubDate>
		<guid>http://forums.oreilly.com/index.php?showtopic=4048</guid>
	</item>
	<item>
		<title><![CDATA[Doesn't (:label || Method) Always Return :label?]]></title>
		<link>http://forums.oreilly.com/index.php?showtopic=3980</link>
		<description><![CDATA[On p. 136 we have:<br /><br />"<br />(:label || method)<br /><br />This looks for an option named :label, letting you specify label text for the field through a :label parameter. If there isn't a :label, the || will fall through to method, which will create a label with the default -- the internal name of the field."<br /><br />Won't this expression always return the value ":label"?<br /><br />Thanks in advance!]]></description>
		<pubDate>Sat, 11 Apr 2009 23:23:42 -0400</pubDate>
		<guid>http://forums.oreilly.com/index.php?showtopic=3980</guid>
	</item>
	<item>
		<title><![CDATA[Ch. 7: :scope & Rails 2.3.2§]]></title>
		<link>http://forums.oreilly.com/index.php?showtopic=3909</link>
		<description><![CDATA[Hiya, <br /><br />I'm really enjoying the book, but note that there appears to be an error with using :scope under Rails 2.3.2. Namely, it doesn't appear to check the named scope <img src="http://forums.oreilly.com/style_emoticons/default/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" />]]></description>
		<pubDate>Thu, 02 Apr 2009 09:46:46 -0400</pubDate>
		<guid>http://forums.oreilly.com/index.php?showtopic=3909</guid>
	</item>
	<item>
		<title>Label_for In Country_select Fails In 2.2.2</title>
		<link>http://forums.oreilly.com/index.php?showtopic=1220</link>
		<description><![CDATA[The chapter 8 examples using a custom country_select helper to override the base work up until you try to add the label_for in an attempt to match country_select invocation to the other cleaned up calls.<br /><br />Country_select is now a plugin, and not part of the rails core, so the "super" in label_for doesn't find a super class.]]></description>
		<pubDate>Mon, 02 Mar 2009 11:02:36 -0500</pubDate>
		<guid>http://forums.oreilly.com/index.php?showtopic=1220</guid>
	</item>
</channel>
</rss>