On 10 May 2010 14:04, Greg Raymond <[email protected]> wrote:
> Colin Law wrote:
>> On 10 May 2010 13:49, Greg Raymond <[email protected]> wrote:
>>> class Address< ActiveRecord::Base
>>> <%= render :partial => "addresses/edit", :locals => { :shippingAddress
>>> => @address} %>
>>> It keeps saying : "undefined method `model_name' for NilClass:Class "
>>> tried this :
>>
>> In the partial have you got something.model_name?  If so then
>> 'something' is nil.
>>
>> In the traceback when you get the error message you should be able to
>> see the line that is failing.
>>
>> Colin
> Thanks Colin for the fast answer :
>
> In the partial I have the "standard" scaffolded code for my Address
> class
>
> So it's a "form_for @address" just like Rails 3 is generates....

You did not say you are using Rails 3 (unless I missed it).  I have no
experience of Rails 3, which is still under development.  You did not
answer the question as to whether you are accessing
something.model_name, nor whether the trace shows the failing line.

You do not specify your knowledge level, if you are just starting I
would not recommend rails 3.  You will never know whether a problem is
down to your experience or a problem with rails itself.

Colin

>
> so I don't understand why I can go to /addresses/1 and see the form but
> I cant view the same info via a partial.
> --
> 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.
>
>

-- 
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