在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
准备: ruby(windows): http://rubyforge.org/frs/?group_id=167 gem: http://rubyforge.org/frs/?group_id=126 gem install rails
rails new blog
sqlite3: development: adapter: sqlite3 database: db/development.sqlite3 pool: 5 timeout: 5000 mysq1: development: adapter: mysql2 encoding: utf8 database: blog_development pool: 5 username: root password: socket: /tmp/mysql.sock postgresql: development: adapter: postgresql encoding: unicode database: blog_development pool: 5 username: blog password: 创建数据库: rake db:create rails server rails generate controller home index # home为控制器 index为方法 生成的代码 app/controllers/home_comtroller.rb class HomeController < ApplicationController def index end end
config/routes.rb Blog::Application.routes.draw do #... # You can have the root of your site routed with "root" # just remember to delete public/index.html. root :to => "home#index" |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论