1

I'm developing a site with Ruby on Rails. I have data on layout that doesn't repeat more then once. And I need to enable content-menegers to change it easily. I could create a model or several models for them and let content-managers edit it in RailsAdmin. But I doubt I should use models that way because entities of such models will be ment to exist in singular number. I mean there aren't multple site names, logos, backgrounds, welcoming texts, etc. But I want to enable them to be edited in a web-interface or equally comfortable not worrying about the cache and not looking at code and serfing through complicated directories structure.

What is the right way to do that?

Gherman
  • 6,768
  • 10
  • 48
  • 75
  • You could use YAML, which Ruby/Rails has lots of support for. It's used, for example, in some of the Rails config files (`.yml`). – lurker Feb 17 '14 at 17:03
  • Yes, but that requires serfing for directory structure and working with code. We asume that content-managers have low computer skills and can(or want to) only work with nice GUI. – Gherman Feb 17 '14 at 17:07
  • OK, it's a little unclear what you're asking, then. I was suggesting using YAML as a format "under the hood" which Ruby/Rails would manage for the user, just like it were in the database. But in this case, you're just managing one set of data (which is what I thought the question was about). – lurker Feb 17 '14 at 17:25
  • OK, so there are tools for GUI management of YAML configs like RailsAdmin for models? – Gherman Feb 17 '14 at 17:35
  • Not as part of Rails. There aren't methods to tie YAML items to GUI entities. If that's what you need, then perhaps a simple one record db table is the way to go. – lurker Feb 17 '14 at 17:43
  • It is way to go for sure, but still a concept of the "one-row-table" seems quirky because tables are ment to have multiple rows. That's why I'm asking. It resembles singleton pattern. – Gherman Feb 17 '14 at 17:52
  • Yes, I do understand what you mean, and it's a good question. – lurker Feb 17 '14 at 17:55

0 Answers0