Again: Please quote when replying!  Otherwise the discussion will be 
hard to follow, and you will be more likely to skip over things in the 
posts you're trying to respond to (as you seem to have done in this 
case).

David G. wrote in post #978245:
> Thanks for your reply.  So let me ask a few specific questions to
> clarify my understanding of Ruby.
>
>
> class UserCommentsController < ApplicationController
>   def new
>     @usercomment = UserComment.new
>
>     respond_to do |format|
>       format.html # new.html.erb
>       format.xml  { render :xml => @usercomment }
>     end
>   end
> ....
>
> I would have thought, given that this was scaffolding, that
> UserComment.new allocated the space for the UserComment, assigned the
> values to nil, and that the view would render them as empty data.  What
> IS this really doing?

It's constructing a UserComment object (not necessarily assigning the 
values to nil, but running the constructor method).

>  I assumed it passes the usercomment to one of to
> format methods that are internal to Ruby on Rails.

Huh?

>  Thanks again!

You completely missed my point from my last post.  Again, I wrote:
>  You're
> setting @usercomment in the controller, then trying to read
> @user_comment in the view.

See the issue there?  If not, then you need to brush up on your powers 
of observation before attempting to program in any language.

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
mar...@marnen.org

-- 
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-talk@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to