rails 第一天 Veröffentlicht am 2015-01-11 Bearbeitet am 2015-09-02 ##常用命令 123rake db:schema:dumprails g model 名称rails g controller 名称 ##常用gem: 123gem 'mysql2'gem 'kaminari' #分页gem 'nokogiri' #DOM分析 kaminarikaminari简要文档 ##使用方法:controller: 12345class AdminsController < ApplicationController def index @admins = Admin.order("id DESC").page(params[:page]).per(1) endend views: 1234<% @admins.each do |b|%><%=b.sbname %><% end %><%= paginate @admins %> 数据库表名后缀添加方法:在config/application.rb添加 1config.active_record.table_name_prefix = 'j_'