开发者

Implementing a singleton in Rails

I took over a project and the previous developer used a CMS where the client could enter text and stuff but the problem was that the client wanted some css and javascript and it turned out that this 'about us' page was something that that developer ended up making changes to because the embedded text was full of markup and javascript at the clients request.

I am trying to make it so the client can just input text and it will self format etc... but it's an about us page and I don't want to create resource for this so that is why I'm thinking singleton.

Basically I want the client to have the ability to edit the a开发者_开发知识库bout us page so it should be attached to the db but it's only one thing. So how would you do this?


Why not just give them a file called about_us.html.erb? They don't have to use ERB in the file. Any time they need to make changes to the file, they can give you a new version and you commit it to your VCS. Or, if you are using something like github.com and they have an account, they can edit the file inline.

You don't even have to have a controller action defined in the controller.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜