0

My rails app is just a personal site. On the site I have content for main pages (mostly text) but I also want to have some other bits of content just as my email address and some social media names and so on.

It feels wrong to store this type of data as text in my actual app. Surely it should be in the database or something.

Is there a way I can store it in a sort of personal_settings table. I just cant see how I would store all the data in one table.

Any ideas?

2 Answers 2

1

If you're only storing data on one person - yourself - it seems like a waste to go through setting up a database, etc. Your database would only have one row! That's not really the point of a database-backed web site. You need a database when users are adding their own data and requesting specific sets of data. Or maybe I'm misunderstanding what you're trying to do?

Sign up to request clarification or add additional context in comments.

1 Comment

It does make sense but on the other side of the debate, it seems wrong to store my personal info/data as part of the app. Maybe I should just keep it as part of the app.
0

One Idea (if you really want to use a database) for simple social media settings (single user)

# 1 - Facebook - 'fb.png'
# 2 - Twitter  - 'tw.png'

create_table :social_media do |t|
  t.string :name
  t.string :ico_url
end

# 1 - 'Apikey' - 'key_data'
# 2 - 'User' - 'user'
create_table :social_media_fields do |t|
  t.integer :social_media_id
  t.string  :name
  t.string  :value
end

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.