How to Set up a Ruby on Rails App for a Job Hire Board and then be ready to write our ruby code? Rails makes it this easy!
So, you’ve got your concept, your domain models, user-stories, mockups, and you’ve white-boarded up those relationships? Now what?
Next thing we can do is start up Rails New. This will near instantly set up an entire Rails App with all of the necessary files and folders to get up and running. Run a bundle install, and *zippety doo* you’re on your way!
Next thing we need is to create migrations and all the necessary files for each of our models. Let’s run rails g resource JobSeeker email password name job_title address profile_picture phone_number resume website
. Boom!
Rails gives us all the resources we need to build out this model, among which are the controller, model, routes, view folder, and most importantly it creates the migration. It happens in this case that we decided all of those attributes would be strings, so no additional information was needed to generate the resource, however, had we decided to add years of experience, for example, we would have added years_experience:integer
to ensure we are indicating the correct data type for our migration. We can run rails g resource
for the remaining domains and then move on to creating some seed data, running rails db:migrate
and then rails db:seed
and then we’re ready to start writing our code!!