That may indeed be the new Rails 3 syntax, I haven't spent any time with that yet, so sorry if I led you astray. But I suspect your problems began when you used the plural name for your scaffold argument. Try again, using rails g scaffold_controller Lesson and see if there is a different output.

Walter

On Nov 7, 2010, at 10:03 PM, Ben Porterfield wrote:

Awesome, this did indeed fix the problem!

However, I didn't write the format code - this code was generated with:

rails g scaffold_controller Lessons

Which leads me to believe that this is the proper format code....3.0.1
generates "format.html {filename}.html.erb" for each controller function
- is this a generator bug, or do I have a problem with my system?

Walter Davis wrote in post #960032:
Just drop the index.html.erb part so your block looks like this:

respond_to do |format|
  format.html
  format.xml { render :xml => @lessons }
end

index.html.erb will already be inferred from the action name, and if
you do want to set it to something different, you would say

respond_to do |format|
  format.html { render :template => '/foo/bar' }
  format.xml { render :xml => @lessons }
end

Walter

--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails- [email protected]. To unsubscribe from this group, send email to [email protected] . For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en .


--
You received this message because you are subscribed to the Google Groups "Ruby on 
Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to