mardi 5 mai 2015

What should be stored in DB when converting site into rails

I believe this is more of a subjective question than not, that being said, I am much newer to rails than a lot of you, so I trust your opinion more than my own. Basically I've been talking to someone I know about redoing there website into a rails app, but I am not sure how the best way to go about setting up the database would be. Here is a link to the site I will be remaking http://ift.tt/1OY6mvK.

My question to you is, what all belongs in a database? My first thought is to create two main tables in the db, sections and articles, and have each article belong to a section. I will store all of the html for the content of each separate pages in the db under a certain section (for instance the "welcome", "FAQs", "Contact Information", and all other links under the about dropdown menu will be separate articles stored in the db which belong to the "About" section.)

**Update 5/05/2015 2:37 PM CDT I should clarify that when I say I will post the html for each of those pages in the database, I do not mean ALL of the html on that given page, just the content on those pages that is unique to that page (so headers, menu bars, etc. will not be stored in the database)

However, I'm beginning to wonder if storing all that html and text in a database would be too much, or would be bad practice, and if it is better to just create separate html files for each page, too make it easier to style text and create tables within text and stuff like that. I see pros and cons to both sides, a huge pro, for example, is the fact that if I did store it in the database I would not need to create 30+ HTML files, and could just pass in different Articles from the database into a preformatted page.

So I'm just looking for some advice on what you guys think is the best way to go about this project! Thanks in advanced for helping me out!

Aucun commentaire:

Enregistrer un commentaire