rails new blog
rails 命令小计
原创yangbin1103 ©著作权
©著作权归作者所有:来自51CTO博客作者yangbin1103的原创作品,请联系作者获取转载授权,否则将追究法律责任
cd blog
bundle install
rake ddb:create
rails s
==========
rails g controller home index
rm public/index.html
config/routes.rb: 设置路由 利用DSL保存木条
root :to => 'Home#index'
采用脚手架:
rails g scaffold post name:string title:string content:text
=====>生成了迁移文件 :
rake db:migrate
'=============
超链接:
<%= link_to 'My Blog', posts_path%>
模型研究:
验证:validates :name, :presence=>true
validates :title, :presence =>true, :length=>{mininujm=>5}
rails c
下一篇:jquery 地址
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
结构体大小计算-结构体对齐
计算某一结构体大小:方法以及规则。
偏移量 #pragma 结构体 结构体大小计算 -
mha命令小计
mha命令小计
mha 命令 小计 -
Rails常用命令
Rails常用命令
Rails常用命令 -
ocp小计
ocp小计
ocp小计 -
ruby on rails 命令大全ruby rails 数据库 html 测试数据
-
rails redis rails redis list
(注:1~8是用mysql创建一个rails项目) &
rails redis rails redis ruby mysql