开发者

Moderated model editing in Rails2

I want to allow users to edit a model, adding a开发者_如何学JAVA picture, url and/or phone number to it. However I don't want these changes to show up until they are confirmed by a moderator. I do however want to allow the users to create new entries without moderation, but they cannot include the picture, url, and/or phone number (they can include basic details like the name and surname). Or better, they can include the picture etc. but at the start only the basic information will show up until the picture etc. are accepted by a moderator.

I'm using Rails 2.3.5.


If you want to keep things simple, you can just have a moderated? on your model. Then have your moderated have complete edit access to un-moderated models.

And when rendered your model, don't show the picture, url, or phone number.

I like Andrew's suggestion above for state-machine and versions, but if you want to keep it simple, a nice flag will do exactly that


It sounds like you need to record the revision history of your model. You can use a plugin like Vestal Versions to do this.

When you update your model, you need to set a moderated flag on it. This could be done with a simple checkbox, or a more advanced state machine plugin.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜