Download - Rails beauty
Transcript
RailsMake it beauty
2nd
这节课讲什么
美化程序,让你好看
又见 Model-View-Controller (MVC)
修改后的效果
建立 Product
rails new s3food
rails generate scaffold Product title:string description:string image_url:string price:decimal
rake db:migrate
rails server (server 可简写为 s)
http://127.0.0.1:3000/products
添加产品
界面
嗯,太难看了
修改 view
修改 app/views/products/index.html.erb
<% @products.each do |product| %>
…
<% end %>
链接 :http://dpaste.com/564865/
图片
放在 public/images 目录下
链接 http://bitcocoa.com/?attachment_id=48
稍微好看些了…
MVC
我们学习了
美化了一下 Product
MVC 概念