I'm looking for the best/most efficient way to add categories that save to a database. I've created the category model with a name column. I generated the controller. My first thought was to just enter the categories directly into the controller since I will be the only one that can create, edit, and destroy them. This is what it looked like:
class CategoriesController < ApplicationController
def women
end
def kids
end
def babies
end
def home_decor
end
end
Fine, but that doesn't save to the db and since I'd like to associate these categories w/ products later I need it to save to the db. I could create these categories directly in console, but I'm not sure if when I push to production (on Heroku) how to create them again (and that seems a little tedious).
The other option I have is to create a form to create the categories and only give access to an admin.
Am I missing something? Is there a more efficient way to do this or is the admin route the best way to handle it?
Thanks for any suggestions!