Rails 3 应用程序/用户设置最佳实践? [英] Rails 3 Application/User Settings best practice?

查看:30
本文介绍了Rails 3 应用程序/用户设置最佳实践?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前需要在 Rails 3 应用程序中允许管理员可配置的全局设置以及每个用户可配置的设置.

是否有适合这种情况的 gem 或最佳实践?

我找到了一些 gem 和博客文章,但它们都可以追溯到 2006-08 年并且不再维护.任何指针将不胜感激,谢谢.

注意:我见过 这个问题带有序列化的哈希响应,但在我的特殊情况下,需要根据用户的设置查询数据库的用户 - 我认为序列化的哈希在这种情况下不会很好地工作.

解决方案

一如既往地寻求帮助后,我的搜索取得了成果.发现 Georg Ledermann 的 rails-settings 分支,看起来它可以满足我的需要.p>

I have a current need for allowing both admin configurable global settings as well as per-user configurable settings within a Rails 3 app.

Are there any gems or best practices that work well for this situation?

I've found a couple of gems and blog posts but they all date back to 2006-08 and are no longer maintained. Any pointers would be appreciated, thanks.

Note: I have seen this question with the serialised hash response but in my particular case the ability to query the database for users based on their settings is required - I don't think a serialized hash would work well in that situation.

解决方案

As always right after asking for help my search bears fruit. Found Georg Ledermann's fork of rails-settings that looks like it will do just what I need.

这篇关于Rails 3 应用程序/用户设置最佳实践?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆