Space on Rails blog is a simple RubyonRails project to illustrate how to pass from a fat-server approach to a client based application.
Installation
Clone the repository and enter the directory:$ git clone https://github.com/lodr/spaceonrails
$ cd spaceonrails
$ bundle install
$ rake db:migrate
$ rake db:seed
$ nohup rails server > /dev/null & (默认使用的端口为3000.如果你的3000端口已被某个程序占用,
可指定运行的 端口:
nohup rails server --port=3009 > /dev/null &
或者简写为:
nohup rails s --port=3009 > /dev/null &也可。
演示站点:http://as3.brite.biz:3009,还不知如何登录以及设置登录帐号。
Project stages
The git project has X tags matching the different stages of the project:v0-plain
is the starting point. All the navigation is handled by the rails application and not even CSS has been applied yet.v1-css
is a little evolution over the starting point. Some advanced CSS has been applied but the navigation continues being synchronous and template driven via server*.erb
files.v2.1-router
starts the web application providing thewebapp
folder as well as the skeleton for the router module (webapp/js/router.js
).v2.2-template
continues with the web application by providing the skeleton for the template processor (webapp/js/template.js
), a little software to manipulate the DOM.v2.3-webservice
introduces the final stage of the web application and provide the skeleton for the different controllers for each blog section (webapp/js/controllers/
). Each controller will modify the model by using a REST API provided by the server in rails.v3-testsuite
adds the test suite required to validate our architecture.v4-done
implements the architecture and passes the test suite.
v0-plain
, v1-css
and v2.1-router
are
available.Changing from one to another is as simple as making check out of the tag. I.e.:
$ git checkout v1-css
$ git checkout v0-plain
$ git checkout -b my-branch-from-v0
项目地址:https://github.com/lodr/spaceonrails
相关帖子:
http://briteming.blogspot.co.uk/2013/12/linux-vpsrubymysqlrobbinsite.html
http://briteming.blogspot.co.uk/2014/01/linux-vpsruby-obtvse2.html
http://briteming.blogspot.co.uk/2013/12/linux-vpsrubyrails-blogcast.html