Ruby on Rails第一眼

【尽管春节前的重组将一切节奏打乱,我还是准备将这个学习进行下去。不想去问这个还有没有意义。有意义,就是充实地活下去。】

学习RoR我打算先去官网看看,正本清源。

http://rubyonrails.org/

第一眼看见这句话“Web development that doesn’t hurt”, 是口号,是宣言,还是vision?

不论如何还是击中泪点啊。(此处作者省略1万字)

安装Rails

1. 检查ruby版本

ruby -v

2. 安装rails

gem install rails

3. 安装完成

rails –version 查看rails版本号

新建项目

我要做的一个项目叫做MyClubs,用来组织各种social club的活动的,例如公司里边足球俱乐部,羽毛球俱乐部以及大名鼎鼎的吃货俱乐部。当然别想太多哦,第一个版本的功能越小越好。计划如下:

a. 用户能够注册和登录;

b. 用户能够创建和加入一个club;

c. 用户能够发起一次活动。例如 ”下周二晚上7点羽毛球活动“

d. 用户能够投票参与或不参与一次活动

e. club的所有成员能够看到投票的统计

好了,动手做吧。在我的龟速硬盘上找块地方就开始吧。

cd /d d:\sandbox

rails new MyClubs

接下来”rails new”命令会帮我创建好一堆目录和文件。(可能跟下表有些出入)

FILE/FOLDERPURPOSE
app/ Contains the controllers, models, views, helpers, mailers and assets for your application. You’ll focus on this folder for the remainder of this guide.
bin/ Contains the rails script that starts your app and can contain other scripts you use to deploy or run your application.
config/ Configure your application’s runtime rules, routes, database, and more. This is covered in more detail in Configuring Rails Applications
config.ru Rack configuration for Rack based servers used to start the application.
db/ Contains your current database schema, as well as the database migrations.
Gemfile
Gemfile.lock
These files allow you to specify what gem dependencies are needed for your Rails application. These files are used by the Bundler gem. For more information about Bundler, see the Bundler website
lib/ Extended modules for your application.
log/ Application log files.
public/ The only folder seen to the world as-is. Contains the static files and compiled assets.
Rakefile This file locates and loads tasks that can be run from the command line. The task definitions are defined throughout the components of Rails. Rather than changing Rakefile, you should add your own tasks by adding files to the lib/tasks directory of your application.
README.rdoc This is a brief instruction manual for your application. You should edit this file to tell others what your application does, how to set it up, and so on.
test/ Unit tests, fixtures, and other test apparatus. These are covered in Testing Rails Applications
tmp/ Temporary files (like cache, pid and session files)
vendor/ A place for all third-party code. In a typical Rails application, this includes Ruby Gems and the Rails source code (if you optionally install it into your project).

【要开会去了,暂停】

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Bruce Jia(上海)

熬夜码字换酒钱

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值