Thu Jan 04, 2007 5:01 am
Replies: 16
Views: 60673
In regards to the previous topic. I tried making the following change with no luck.

<%= render :partial => 'category', :locals => { :category => post.category } %& ...

Tue Jan 02, 2007 1:19 am
Replies: 16
Views: 60673
OK, you're going to want to start by editing the post & category models, because you're changing the relationship between them. The category will now be:
has_many :posts

and the post will ...

Mon Jan 01, 2007 12:39 am
Replies: 16
Views: 60673
fulvio - You're right that the code posted doesn't work the way you'd expect. Back when I wrote this I was quite a newbie at Rails, and the categories feature wasn't thought-through properly

Here's ...

Sun Dec 31, 2006 4:14 am
Replies: 16
Views: 60673
fulvio,

Is the categories select box empty or totally missing? If the latter, do you have the following in the "edit" method of controllers/posts_controller.rb controller:

@categories = Categor ...

Wed Dec 27, 2006 2:00 pm
Replies: 16
Views: 60673
Hi,

I'm using the following:

<% unless @categories.empty? %>
<p>
<select name="post[category_ids][]" id="post_category_title" class=" ...
Page 1 of 1
All times are GMT