• ruby on rails 实战(二)


    1,修改routes文件,让所有的action都可以使用get或者post方式访问

     match "/:controller/:action" => "controller#action"  , via: [:get, :post]

    2,创建一个数据库表user 

    $ rails g scaffold user name:string hashed_password:string salt:string

    输出内容:

    invoke active_record
    create db/migrate/20131102121128_create_users.rb
    create app/models/user.rb
    invoke test_unit
    create test/models/user_test.rb
    create test/fixtures/users.yml
    invoke resource_route
    route resources :users
    invoke scaffold_controller
    create app/controllers/users_controller.rb
    invoke erb
    create app/views/users
    create app/views/users/index.html.erb
    create app/views/users/edit.html.erb
    create app/views/users/show.html.erb
    create app/views/users/new.html.erb
    create app/views/users/_form.html.erb
    invoke test_unit
    create test/controllers/users_controller_test.rb
    invoke helper
    create app/helpers/users_helper.rb
    invoke test_unit
    create test/helpers/users_helper_test.rb
    invoke jbuilder
    create app/views/users/index.json.jbuilder
    create app/views/users/show.json.jbuilder
    invoke assets
    invoke coffee
    create app/assets/javascripts/users.js.coffee
    invoke scss
    create app/assets/stylesheets/users.css.scss
    invoke scss
    identical app/assets/stylesheets/scaffolds.css.scss

    $ rake db:migrate

  • 相关阅读:
    经纬度转十进制 、十进制转经纬度 、没有秒
    PowerDesigner使用
    Kafka日志存储原理
    ambari rest api (三)
    ambari rest api (修改集群配置文件)
    使用QJM构建HDFS HA架构(2.2+)
    Hadoop NameNode 高可用 (High Availability) 实现解析
    hadoop2.x Federation
    hdfs HA原理
    使用JSONObject生成和解析json
  • 原文地址:https://www.cnblogs.com/fanxiaopeng/p/3404109.html
Copyright © 2020-2023  润新知