Ruby on rails

本文介绍了如何在一天内快速上手Ruby on Rails,包括安装Ruby及Rails环境、创建项目、搭建服务器、生成控制器及页面、配置数据库并实现基本的增删改查功能。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

yesterday,I spent 2hours to study ruby on rails,how to set up the development framework,and build up an example to show the great MVC framework charm.

commands refer below:

1.install ruby
2. install rails
   gem install rails --remote
   gem install rails --include -dependencies


3.create a project
  rails cookbook

4.run the server
   ruby script\server

5.create a page(for test use)
  ruby script\generate controller Aaron
 ## Modify the aaron_controller.rb add a function


6.create table in mysql  database:ruby  table:cookbooks
  add modify the database.yml in config fold.
 
7.interact with mysql
  ruby script\generate model cookbook
  ruby script\generate controller cookbook

  Need add the  scaffold:cookbook   in cookbook_controller.rb
 
8.run the webpage
  http://localhost:3000/cookbook  (CRUD)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值