Melvin Ram wrote:
> http://pastie.org/private/ju5htjk8kqjdqik94br0nw
> 
> Line 11 in this pastie is causing errors. errors are including in
> pastie. I was basing this on the example on
> http://ryandaigle.com/articles/2009/2/1/what-s-new-in-edge-rails-nested-attributes
> ... any ideas on what I'm doing wrong?

Hi Melvin,

I'm not 100% sure on this, but it looks like your syntax is wrong from 
the way that I know it. In the line:

= user_form.label :password, user_form.object.new_record? nil : "Change 
password"

new_record? is a method that returns true or false, that's why the 
question mark at the end.  My guess is that you are passing nil to the 
method new_record?() rather than correctly doing the inline if/else.

to do it inline I would write it like this:

user_form.object.new_record? ? nil : "Change password"

Otherwise my next guess would be that some object isn't initiated in the 
controller somewhere.
-- 
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 [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