On 18 November 2011 14:17, gbolahan a. <[email protected]> wrote:
> undefined method `model_name' for NilClass:Class
>
> Extracted source (around line #1):
>
> 1: <%= form_for(@category) do |f| %>

As I think I mentioned in a previous mail, if you see 'nil' in an
error message it quite likely indicates that something is nil.  Since
the only variable on that line is @category I think there is a strong
possibility that it is nil.  The reason for that particular error is
that it is trying to find the name of the model that @category is, but
as it is nil the error is shown.

Colin

> 2:   <% if @category.errors.any? %>
> 3:     <div id="error_explanation">
> 4:       <h2><%= pluralize(@category.errors.count, "error") %>
> prohibited this category from being saved:</h2>
>
> this is another error i encounterd while trying to create a new category
> in my category model.
>
> can someone pls help out on this
>
> --
> 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.
>
>



-- 
gplus.to/clanlaw

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