-1

好的,到目前为止已经学会了开发WordPress网站,并且已经开发主题大约2年了。但是,我想进入“实际”网络开发,而不是 WordPress。我偶然发现了 Rails,并且一直在做一些研究,但是我仍然不知道使用 Rails 创建网站需要什么。

我需要模板文件的方式与在 WordPress 中需要它们的方式相同吗?如果是这样,我需要建立一个网站的最少文件是多少?(例如 index/home.php、侧边栏、页眉、页脚?)我需要对 SQL 有深入的了解吗?我可以将 Rails 与大多数托管服务一起使用吗?在我开始对 RoR 进行一些实际学习之前,我需要了解的第一件事是什么(我喜欢边学习边学习——例如,开始学习 HTML 的人通常通过边学习边构建网站来学习)。

再次,我很抱歉向那些对这些东西非常敏感的人提出如此可怕的问题。但我要求你容忍我,因为我们都在某一点上是任何事情的完全初学者。

干杯。

4

5 回答 5

6

Rails is quite different from Wordpress at a fundamental level:

  • Wordpress is flexible application software that can be used for blogging, as a Content Management System for building websites and more.

  • Rails is is flexible application building software. It is used to build web applications including web sites and more.

For example, you could use Rails to build the equivalent of Wordpress. Wordpress itself was built using an alternative to Rails, php.

Templates Yes, both Wordpress and Rails use templates.

  • In Wordpress, most of your customization of Wordpress is done using templates.
  • In Rails, templates are just one part of your application. Other key parts are models and controllers.

Other questions/answers

  • Do I need template files the same way I need them in WordPress? Yes, you usually use them, but they are just one part of Rails apps.
  • Do I need a deep understanding of SQL? A. You need to understand more about what's going on in the database with Rails than with WP. But you don't need a "deep" level of SQL. Rails handles most all of the sql for you. You do need to understand the ideas of tables, joins, columns, column types and how to choose them.
  • Can I use Rails with most hosting services? A. Not as easily as WP. Ask your hosting service to see what their answer is about Rails. There are low cost hosting services that work well with Rails. DreamHost is one.
  • What is the firs thing I need to understand before I begin to do some practical learning on RoR (I like to learn as I go along - for instance, people starting out learning HTML learn usually by building a website as they go along). A. Understand the difference between an application (WP) and a programming system that enables you to build applications (Rails).

Summary If you can do what you need to do in Wordpress then it is probably a good solution for your task. If you can't accomplish your task using Wordpress, or it seems like too much work to do so, then investigate Rails.

Next step I suggest that you get book on Rails and use it to learn the system.

Added

Both Wordpress and Rails are fantastic open source projects. I use both and think that they are both great in their own ways.

I would not recommend Rails if you want to build a web content site. I do recommend it if you want to build a web application.

  • You want to build a website where the pages are static except for a "add me to the email list" form. Use WP.
  • You want to build a web page application which enables visitors to donate to a non-profit. Using plugin for WP would probably be the fastest solution. Or get a "Donate button" from Paypal or similar.
  • You want to build a custom application which enables donors to organize themselves into teams, raise money and graph the on-going competition between the teams. This would be a good use of Rails.

Rails as a software learning tool If you want to learn or improve your skills at writing software, Rails is a good choice. It enables you to write large systems in the Ruby language. WP enables you to use php, but it is much easier to use Ruby to write object oriented software.

于 2012-06-04T14:45:19.650 回答
2

rails new appname:) 遵循教程,例如:

http://ruby.railstutorial.org/

除此之外,这个问题太宽泛了。

于 2012-06-04T14:29:12.143 回答
2

网上有很多教程,一点点谷歌会有所帮助。

同时,假设您已经安装了 Rails,通过打开终端并键入来生成一个简单的 Web 应用程序

rails new testapp

这将创建你的 Rails 应用程序——当然是最基本的。

启动你的服务器

rails server

然后去

http://localhost:3000

查看文件系统上的目录和文件,看看里面有什么。其中大部分可能令人困惑,但这是意料之中的——你才刚刚开始。您将能够通过谷歌搜索和提问来了解这一切是如何运作的。

它还有很多内容,但这只是开始。当您获得更多学习知识时,请确保查看rvmbundler

于 2012-06-04T14:32:03.050 回答
1

查看TryRuby.orgCodeschool.com - 他们会让您立即启动并运行。

于 2012-06-07T14:44:14.220 回答
0

我也来自 Wordpress。我曾经喜欢 wordpress,但现在我意识到我最好使用 RoR。

在 RoR 中,您可以创建您想要的,或者您的客户想要的。所以强烈推荐。

至于模板。这是不一样的。Rails 使用部分模板。您仍然可以拥有页眉、页脚、侧边栏等。

您以前看过 RoR 网站吗?

@Dave Newtown 是对的.... http://ruby.railstutorial.org/

于 2012-06-04T14:30:31.007 回答