基于 Web 的桌面,带有 ruby on Rails
我是 RoR 新手,我正在尝试创建一个类似于 Web 桌面的 Web 应用程序。 “桌面”将类似于 iGoogle,您可以在其中拖放块。
在这个项目中,我肯定需要使用 OAuth 来连接其他服务提供商,例如 Facebook、Twitter。目标是让用户使用网络浏览器从多个设备(手机、平板电脑、笔记本电脑)访问他们的“桌面”,并且用户可以在身份验证过程后在“桌面”上使用他们想要的服务(Facebook、Twitter)。
所以我的问题是:MVC适用于这个项目吗?因为一般数据库仅用于存储用户信息和类似iGoogle的块。如果是的话,RoR 会是一个很好的解决方案吗?感谢您的建议。
I'm new to RoR and I'm trying to create a web application that acts like a web desktop. The 'desktop' will be something similar like iGoogle, where you can drag and drop the blocks.
In this project, I will definitely have to connect with other service providers such as Facebook, Twitter with OAuth. The goal is to let users access their 'desktop' from multiple devices (mobiles, tablets, laptops) using web browsers, and users can use their desire services(Facebook, Twitter) on the 'desktop' after the authentication process.
So my question is: Is MVC applicable in this project? Because generally the database only for storing user's information and the iGoogle-like blocks. If yes, would RoR be a good solution for this? Thanks for your advises.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
它可能会为你完成这项工作。有很多“宝石”可以为您执行 OAuth。这可能会节省您的开发时间。由于您想要存储和访问数据,MVC 可能会为您完成这项工作。您还可以在没有模型的情况下制作控制器/视图。或者单独型号,具体取决于您的需要!另外,在 Rails 中进行 Ajax 调用非常简单,这可能非常适合您的 iGoogle 之类的应用程序。
但这一切不应该成为使用 Rails 或任何其他语言的要点。使用您熟悉的语言。如果你的日程很紧,学习一门新的语言/框架/...可能是一个糟糕的选择。我的建议是,尝试制作一个简单的应用程序,例如 Rails 中的博客,看看这种语言是否适合您! (在互联网上搜索示例)
您可以在客户端很好地使用JQuery。您可能还想考虑查看 Jquery Mobile,具体取决于您想要做什么。
http://jquerymobile.com/
有很多网站可以帮助您入门。我建议观看railscast.com 上的视频和教程,看看rails 是否适合您。
这是一些链接
http://railscasts.com/episodes/310-getting-started-with-rails 和
http://rubyonrails.org/screencasts
祝你好运!
It will probably do the job for you. There are a lots of "gems" that can do the OAuth for you. That will probably save you time on development. MVC will probably do the job for you since you want to store and access data. You can also make controllers / views without a model. Or models separate, depending on what you need! Additional, making ajax calls in rails is easy as can be, this will probably be a good fit for your iGoogle like application.
But this all shouldn't be the main point for using rails or any other language. Use a language you are familiar with. Learning a new language/framework/... can be a bad choice if you are on a tight schedule. My suggestion is, try to make a easy application for example a blog in rails and see if this language works for you! (search the internet for examples)
You can use JQuery well on the client side. You might also want to consider looking at Jquery Mobile, depending on what you want to do.
http://jquerymobile.com/
There are a loat of websites to get you started. I suggest watching video's and tutorials on railscast.com to see if rails works for you.
Here are some links
http://railscasts.com/episodes/310-getting-started-with-rails and
http://rubyonrails.org/screencasts
Good luck!
MVC 使您能够以(相对)简单的方式处理数据库以及复杂的数据和表关系。这是因为拥有一个内存占用不是最轻的大型框架的成本。
如果您只想在数据库中存储少量键/值信息并存储一些基本的用户信息,则不需要复杂的关系。我建议使用像 Sinatra 这样的微框架(像 Rails 一样基于机架)来尝试你的想法,然后看看如果它足以满足您的需求。但是,如果您已经制定了更复杂的扩展计划,RoR 可能是更好的选择。
我认为 MVC 适用,因为您希望以受控且可维护的方式存储和访问数据。对于您的目的而言,RoR 的开销可能太大。如果 - 比如说 - 对于像这样的小型应用程序来说,内存占用对您来说并不那么重要,Rails 可以完成这项工作,但您肯定只需要使用其中的一小部分。
MVC give you the advantage of dealing with the database and complex data and table relationships in an (relatively) easy way. This comes with the cost of having a big framework that has not the lightest memory footprint.
If all you want to do is store a handful of key/value information in the database and have some basic user information stored, there are no complex relationships required. I'd recommend trying your idea with a micro framework like Sinatra (which is Rack-based like Rails) and see if it is enough for your needs. However, if you already have extension plans for more complexity, RoR is maybe a better choice.
I'd say MVC applicable because you want to store and access data in a controlled and maintainable way. RoR might be too much overhead for your purposes. If –say– memory footprint isn't that important to you for a small app like this, Rails will do the job but you will definitely just need to use a tiny subset of it.