Rails

来自开放百科 - 灰狐
(版本间的差异)
跳转到: 导航, 搜索
(项目)
第137行: 第137行:
  
 
==项目==
 
==项目==
 +
[[文件:Mastodon-logo.png|right|Mastodon]]
 
*[https://github.com/ekremkaraca/awesome-rails Awesome Rails] [[image:awesome.png]]
 
*[https://github.com/ekremkaraca/awesome-rails Awesome Rails] [[image:awesome.png]]
 
*[https://github.com/hothero/awesome-rails-gem Awesome Rails Gem] [[image:awesome.png]]
 
*[https://github.com/hothero/awesome-rails-gem Awesome Rails Gem] [[image:awesome.png]]
第142行: 第143行:
 
*[https://github.com/thoughtbot/suspenders Suspenders]
 
*[https://github.com/thoughtbot/suspenders Suspenders]
 
*[https://github.com/RailsApps/rails-composer Rails Composer]
 
*[https://github.com/RailsApps/rails-composer Rails Composer]
 +
*[[Mastodon]]
 
*[[Redmine]]
 
*[[Redmine]]
 
*[[OpenProject]]
 
*[[OpenProject]]

2022年3月24日 (四) 13:58的版本

Wikipedia-35x35.png 您可以在Wikipedia上了解到此条目的英文信息 Rails Thanks, Wikipedia.
Rails-90x90.png

Ruby on Rails

目录

简介

Ruby on Rails.jpeg 是一个相对较新的 Web 应用程序框架,构建在 Ruby 语言之上。它被宣传为现有企业框架的一个替代,而它的目标,简而言之,就是让生活,至少是 Web 开发方面的生活,变得更轻松。

Rails可在以下Web Server部署

功能

开发指南

深入Rails

Rails组件:

  • Action Controller
  • Action View
  • Active Record
  • Action Mailer
  • Active Resource
  • Railties
  • Active Support

安装

gem install rails
or gem install -v=5.2 rails
rails new myapp
cd myapp; rails server
http://localhost:3000

注:不用apt-get install rails 因版本较旧

旧版:安装 Ruby:

Linux/UNIX

http://download.huihoo.com/ruby/ruby-1.8.6.tar.gz
tar xzvf ruby-1.8.6.tar.gz
cd ruby-1.8.6
./configure –prefix=/usr/local/ruby
make && make install
修改 .bashrc
export PATH=/usr/local/ruby/bin:$PATH
http://download.huihoo.com/ruby/rubygems-0.8.11.zip
unzip rubygems-0.8.11.zip
cd rubygems-0.8.11
ruby setup.rb
gem install rake

Windows

http://download.huihoo.com/ruby/ruby186-26_rc2.exe

Rails 6

Rails 6.1

Rails 5

Rails 4

Rails 3

Rails 2

按顺序安装

http://download.huihoo.com/rails/rails-2.1.0.zip
gem install activesupport-2.1.0.gem
gem install activerecord-2.1.0.gem
gem install actionpack-2.1.0.gem
gem install actionmailer-2.1.0.gem
gem install activeresource-2.1.0.gem
gem install rake-0.8.1.gem
gem install rails-2.1.0.gem   
rails -v 显示Rails 2.1.0 :)

或者

gem install -v=2.1.0 rails

Rails 1

安装 Rails:

http://download.huihoo.com/rails/rails-1.2.3.zip

按顺序安装

gem install activesupport-1.4.2.gem
gem install activerecord-1.15.3.gem
gem install actionpack-1.13.3.gem
gem install actionmailer-1.3.3.gem
gem install actionwebservice-1.2.3.gem
gem install rails-1.2.3.gem   
rails -v 显示Rails 1.2.3 :)

可能出现的问题: undefined method `gem' for main:Object, 可能是gem的版本太低,升级一下 gem

# gem update --system

Fast CGI and Apache2 for Windows XP

卸载 Rails 1.2.3

gem uninstall Rails
gem uninstall Rake
gem uninstall Actionwebservice
gem uninstall Actionmailer
gem uninstall Actionpack
gem uninstall Activesupport
gem uninstall Activerecord

Simple Weblog

Sample Weblog

强力推荐这个例子 :)

  • Use Rake tasks and migration files to create and update database tables
  • Use the scaffold generator to generate a basic create, read, update, delete (CRUD) database web application
  • Edit views to fine tune the web pages
  • how to build relationships (one-to-one and one-to-many) between models

逐步创建的表结构:

001_create_posts.rb
002_add_body_to_post.rb // 加入新的字段
003_create_comments.rb // 创建新的表

用户

项目

Mastodon

Eclipse

数据库

链接

Rorcast.jpg - http://blogs.huihoo.com/?p=254

文档

书籍

Agile-web-rails.gif http://www.china-pub.com/computers/common/info.asp?id=30058

第一版代码:

第二版代码:

第三版代码:

第四版代码:

Top ROR Demos Exampls Code

Wikipedia-35x35.png 您可以在Wikipedia上了解到此条目的英文信息 Rails Thanks, Wikipedia.

Top ROR Hosts

图集

分享您的观点
个人工具
名字空间

变换
操作
导航
工具箱