Hello everyone, in my Rails 3.0.4 app, I created a partial called
_category.html.erb that makes part of the category scope of the app like
categories_controller, category.rb (the model) and so on. But, when I do
render the partial in app/views/categories/index.html.erb it shows the
following error:
NoMethodError in Categories#index
Showing *
/Users/saulolopes/code/parla/app/views/categories/_category.html.erb* where
line *#1* raised:
undefined method `css'' for nil:NilClass
Extracted source (around line *#1*):
1: <li class="<%= "category-#{category.css}"%>">
2: <%= link_to image_tag(category.picture_file_name),
category_path(category) %>
3: <p class="<%= "category-title
cat-#{category.css}"%>"><%= link_to category.name,
category_path(category) %></p>
4: </li>
I am using Inherited Resources in my CategoriesController but I don''t
think
it''s actually causing any error.
Can anyone help? Thanks!
--
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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.