Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Rails beauty

391 views

Published on

Published in: Education, Technology
  • Be the first to comment

  • Be the first to like this

Rails beauty

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

×