模板定制/rails重载
我正在寻找给予用户修改的能力 Rails 应用程序的最小部分中的代码,该部分位于应用程序目录中。 我坚持“不在生产中自动重新加载任何内容”,有办法避免吗?
(谈论“用户的模板定制”;液体是解决这个问题的方法吗?看起来不是这样,但仍然可以)。
谢谢如果有帮助。
I'm looking for giving the ability to user to modify
code in a minimal part of a rails app, part that is located in the app directory.
I'm stuck with the "not reload anything automatically in production", is there a way to avoid it ?
(talking about "user's template customization"; is liquid a way through this problem ? don't seem so , but still, could be).
thanks if any help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
允许用户修改代码!? WTF!?
换句话说,我强烈建议不要这样做。 :)
Allow a user to modify code!? WTF!?
In other words, I would highly recommend against that. :)
您可以在开发模式下部署您的应用程序...
但话又说回来,就像 Fig-gnuton 所说,您不应该这样做,必须有更好的方法来完成您想要做的事情。
You could deploy your application in development mode...
But then again, like fig-gnuton said, you should not do that, there must be a better way of doing what you're trying to do.
这当然就是变量和数据库的用途吗? 存储用户首选项并使用这些首选项来更改用户浏览器上的输出内容。
模板定制是指 .html.erb 文件吗? 为什么你不能使用 CSS 来通过某种疯狂的 body 类来做到这一点。
Surely thats what variables and the database is for? Storing user preferences and using those preferences to alter what is output onto the users browser.
By template customization do you mean the .html.erb files? Why can't you use CSS to do this by using some sort of body class madness.
我建议您不要让用户更改应用程序内容。 相反,如果您希望用户更改模板,您应该将它们存储在数据库中。 就像 browsercms 和 Radiant 项目一样。
I would suggest you to not let users change app contents. Instead, if you want users to change the templates, you should store them in the database. Just like the browsercms and Radiant projects, to mention some, do.