简体   繁体   English

是否允许在没有 session 数据或用户 class 的情况下将订单放置在轨道 web 应用程序中

[英]Is it okay to allow orders to be placed in rails web app without session data or users class

I have a question for a project I am working on.我有一个关于我正在从事的项目的问题。 I am working on a RoR project in which a site is selling a single type of item, a book.我正在做一个 RoR 项目,其中一个网站正在销售一种类型的物品,一本书。 The person I am creating this for does not want to deal with users creating user account to check out as the sales season is very short for this product, the purchases are done once per year, and the site only sells a single item.我为其创建此产品的人不想与创建用户帐户以进行结帐的用户打交道,因为该产品的销售季节非常短,购买每年进行一次,并且该网站仅销售一件商品。

I am wondering if there is something wrong with the implementation I am thinking of.我想知道我正在考虑的实现是否有问题。 What I was envisioning was a single database class called Orders.我所设想的是一个名为 Orders 的单一数据库 class。 visitors to the site would simple fill out an order form with payment details through stripe and click submit.该网站的访问者只需通过条纹填写带有付款详细信息的订单,然后单击提交即可。 If they payment clears, the order with all the Orders information would be persisted to the DB.如果他们的付款清除,带有所有订单信息的订单将被保存到数据库中。 If the payment fails then it is not persisted and the relevant error information is displayed in using flash.如果支付失败则不持久化,使用flash会显示相关错误信息。

I suppose the meat of my question is;我想我的问题的重点是; is there anything inherently 'wrong' about implementing this model without a users class and just having visitors to the site place orders?在没有用户 class 的情况下实施此 model 并且仅让网站访问者下订单,是否存在任何固有的“错误”?

I am a fairly new developer and this is my first big project so any feedback is appreciated!我是一个相当新的开发人员,这是我的第一个大项目,因此感谢任何反馈!

If your requirements say that it is okay, then it is okay, if your requirements say it is not okay, then it is not okay.如果你的要求说可以,那就可以,如果你的要求说不行,那就不行。

There's not more to say, since only you know what your requirements are.没有更多可说的,因为只有您知道您的要求是什么。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 允许用户编辑其帐户而无需提供密码| 轨道4 - Allow users to edit their account without providing a password | Rails4 如何允许用户在不登录的情况下创建内容(Rails、Devise) - How to allow users to create content without logging in (Rails, Devise) Rails应用程序将不记得用户,然后允许重新登录 - Rails app won't remember users and allow then to re-sign in 允许我的 Web 应用程序的用户发布到他们的个人 Facebook 页面 - Allow users of my web app to post to their personal facebook page Rails范围通过信誉得分对用户进行排序 - Rails scope that orders Users by a Reputation Score Rails - 让用户从多个设备登录而不会破坏会话 - Rails - Let users sign in from multiple devices without destroying session 更改Rails会话cookie域而不注销用户 - Change Rails session cookie domain without logging users out rails可以允许用户“仅”编辑数据,但查看所有人 - rails cancan allow users to edit *only* their data, but view everyones 是否可以在Rails 4中命名每个项目“app”? - Is it okay to name every project “app” in Rails 4? Rails 4应用程序:如何允许用户邀请其他用户在特定模型实例上进行协作? - Rails 4 app: how to allow users to invite other users to collaborate on a particular model instance?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM