StartupInstituteChicago / Spring2014HerbPreintz

0 stars 0 forks source link

What is used in the rails g model for <checkbox> and <radiobutton> ? #7

Open hpreinitz opened 10 years ago

hpreinitz commented 10 years ago

I am creating a profile form for the partner project that has checkboxes and radio buttons. I haven't found what is used in the rails g model for and Does anyone know what to use in this case?

$ rails generate model Profile name:string bio:text ... petsok: gender:

diffractometer commented 10 years ago

Models are so easy to write, I wouldn't use a generator for them. I think the generator is a little misleading because it also is making a migration, you may just want to make the migration, then make the model and spin up the rails console to check that you can make a call to the db and create an object of your class you created (after you migrate)

They all have the structure

class Profile < ActiveRecord::Base

stuff

end

remember that most of that "rails magic" should be happening in the model. it's where you really get to play with your data.

On Thu, Mar 27, 2014 at 5:22 PM, hpreinitz notifications@github.com wrote:

I am creating a profile form for the partner project that has checkboxes and radio buttons. I haven't found what is used in the rails g model for and Does anyone know what to use in this case?

$ rails generate model Profile name:string bio:text ... petsok: gender:

Reply to this email directly or view it on GitHubhttps://github.com/StartupInstituteChicago/Spring2014HerbPreintz/issues/7 .

hpreinitz commented 10 years ago

Thanks Hunter. I was doing some reading in the Hartl book about models.