I have a database table ‘pages’ that is called for the specific pages of
the website. Now that I am starting to implement the project I am
looking into how I can have a home page that is called everytime just as
the home page.
Right now I have categories table has_many pages.
How can I come up with a solution to having a home page in the database?
I was thinking of just creating the home page in the scaffold - then add
a column to the table thats titled say index, then have the page I want
as the home page to have index set to 1 and not allow scaffolds to
change that value for any page.
The problem I see with this idea is that to call the information to the
main page I would need to set my instance variable with a condition =>
"index = 1
" or something like that. Well what would happen if a user clicked on a
category page? With my idea i do not see how any other information would
but I am not sure - of course, I at this point do not know how to pass
requests i.e. when a user clicks on a category page, back to the index
page for the view to render the new information.