Welcome to Working With Rails


Discussion Forums

Discuss all things Ruby on Rails with perhaps the web's most vibrant group of Ruby on Rails enthusiasts.
How to show a list of radio_button Categories in another model
5 Posts
How to show a list of radio_button Categories in another model

Hi Nelson,

for your trouble Jason has already been provided good solution..

may be there is problem at other place

I'm providing you sample code.. which is working perfect at my side.


Just go through above link.. I hope this will help you..

Good Luck ;)

-Ganesh K

Jruby, Ruby, Rails Programmer
Sign In To Rate Post

OK Jason. Looks like its not working.

I wanted to be able to select a category from the list of radio buttons and associate the category with the job. I get an error saying "Could not find Category without an id"

What am I doing wrong?

Thanks a lot Jason. It worked but do i have to do this bq. {:multipart => true } do |f| %> bq. ?

I have been ill for a while but am back now.

Now am wondering how to populate the table :category_id so that when I do @jobs.category.find(params[:category_id]) if this is right,

i return all the jobs under that category. How do I deal with the actions in the controller/model?


You'll just have something like this, within your @form_for@ block:

That'll work in your edit form as well.

Hi, Am new to Rails and Ruby. I have 2 models Job and Category. I want to select a category from a radio_button list when creating a new job in the jobs => :new action.

Could someone tell me how to deal with the form_for @jobs given that this same form is also used to upload a logo image.

5 Posts
Login to add your message