kamilanindita / ruby-on-rails-simple-crud-mongodb-with-scaffold

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ruby-on-rails-simple-crud-mongodb-with-scaffold



Installations

  1. rails new ruby-on-rails-crud-mongodb-with-scaffold --skip-active-record
  2. cd ruby-on-rails-crud-mongodb-with-scaffold
  3. add gem 'mongoid', '~> 7.0.5' and gem 'bson_ext' in Gemfile
  4. bundle install
  5. generate MongoDB configuration files
    => rails g mongoid:config
  6. configuration database connection
  7. add a model use scaffold and Mongoid will automatically add a module include Mongoid::Document in that class
    => rails g scaffold buku penulis:string judul:string kota:string penerbit:string tahun:integer
  8. no need to migrate
  9. add root :to => 'bukus#index' in routes.rb
  10. rails s

About


Languages

Language:Ruby 70.9%Language:HTML 17.1%Language:JavaScript 8.0%Language:CSS 4.0%