[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"detail-sidebar-cat-0-en-105":3,"doc-seo-681160-105":59,"doc-detail-681160-en":130,"doc-similar-681160":162},{"code":4,"msg":5,"data":6},0,"success",[7,13,18,23,28,33,38,43,48,51,55],{"id":8,"doc_module":4,"doc_module_name":9,"category_name":10,"show_sort_weight":11,"slug":12},1,"Document","Story & Novel",90,"story-novel",{"id":14,"doc_module":4,"doc_module_name":9,"category_name":15,"show_sort_weight":16,"slug":17},2,"Literature",80,"literature",{"id":19,"doc_module":4,"doc_module_name":9,"category_name":20,"show_sort_weight":21,"slug":22},4,"Exam",70,"exam",{"id":24,"doc_module":4,"doc_module_name":9,"category_name":25,"show_sort_weight":26,"slug":27},5,"Comic",60,"comic",{"id":29,"doc_module":4,"doc_module_name":9,"category_name":30,"show_sort_weight":31,"slug":32},6,"Technology",50,"technology",{"id":34,"doc_module":4,"doc_module_name":9,"category_name":35,"show_sort_weight":36,"slug":37},7,"Healthcare",40,"healthcare",{"id":39,"doc_module":4,"doc_module_name":9,"category_name":40,"show_sort_weight":41,"slug":42},8,"Research & Report",30,"research-report",{"id":44,"doc_module":4,"doc_module_name":9,"category_name":45,"show_sort_weight":46,"slug":47},9,"Religion & Spirituality",20,"religion-spirituality",{"id":46,"doc_module":4,"doc_module_name":9,"category_name":49,"show_sort_weight":46,"slug":50},"World Cup","world-cup",{"id":52,"doc_module":4,"doc_module_name":9,"category_name":53,"show_sort_weight":52,"slug":54},10,"Lifestyle","lifestyle",{"id":56,"doc_module":4,"doc_module_name":9,"category_name":57,"show_sort_weight":24,"slug":58},19,"General","general",{"code":4,"msg":60,"data":61},"ok",{"site_id":62,"language":63,"slug":64,"title":65,"keywords":66,"description":67,"schema_data":68,"social_meta":123,"head_meta":125,"extra_data":127,"updated_unix":129},105,"en","6170-tutorial-2-rails-basics-topic-0-useful-commands-when-developing-rails-applications","6.170 Tutorial 2 Rails Basics - Topic 0 Useful commands when developing rails applications","","Tutorial 2 covers Rails basics through prerequisites, goals, and an introductory walkthrough of Ruby on Rails. It explains what Rails is, the features it provides (MVC separation, rapid web development, DB access and migrations, rake automation), and introduces Heroku and Git as supporting tools. The tutorial then presents useful development commands (rails, rake) and begins Topic #1 on routing, including resourceful and non-resourceful routing with example routes, controllers, and views.",{"@graph":69,"@context":122},[70,84,105],{"@type":71,"itemListElement":72},"BreadcrumbList",[73,77,79,82],{"item":74,"name":75,"@type":76,"position":8},"https://docshare.wps.com","Home","ListItem",{"item":78,"name":9,"@type":76,"position":14},"https://docshare.wps.com/document/",{"item":80,"name":30,"@type":76,"position":81},"https://docshare.wps.com/document/technology/",3,{"item":83,"name":65,"@type":76,"position":19},"https://docshare.wps.com/document/6170-tutorial-2-rails-basics-topic-0-useful-commands-when-developing-rails-applications/681160/",{"url":83,"name":65,"@type":85,"image":86,"author":91,"headline":65,"publisher":94,"fileFormat":97,"inLanguage":63,"description":67,"dateModified":98,"datePublished":99,"encodingFormat":97,"isAccessibleForFree":100,"interactionStatistic":101},"DigitalDocument",{"url":87,"@type":88,"width":89,"height":90},"https://docshare.wps.com/thumbnails/6170-tutorial-2-rails-basics-topic-0-useful-commands-when-developing-rails-applications/681160.png","ImageObject",300,407,{"name":92,"@type":93},"Cipher","Person",{"url":74,"name":95,"@type":96},"DocShare","Organization","application/pdf","2026-11-25","2026-11-06",true,{"@type":102,"interactionType":103,"userInteractionCount":19},"InteractionCounter",{"@type":104},"ViewAction",{"@type":106,"mainEntity":107},"FAQPage",[108,114,118],{"name":109,"@type":110,"acceptedAnswer":111},"What are the prerequisites for Tutorial 2 Rails Basics?","Question",{"text":112,"@type":113},"The tutorial requires RoR installed and a working “Hello World” app, familiarity with separation of concerns and MVC controller, and some database knowledge (useful but not necessary).","Answer",{"name":115,"@type":110,"acceptedAnswer":116},"What does the “rails” command do in Rails development?",{"text":117,"@type":113},"The “rails” command provides scripts for auto code generation and other development tasks. Examples include creating a new project and generating assets, models, and resources.",{"name":119,"@type":110,"acceptedAnswer":120},"What are the two kinds of routing described in Rails?",{"text":121,"@type":113},"Rails routing is described as resourceful routing (shorthand for resources) and non-resourceful routing (for all other routing), with examples of how each maps paths to controller actions.","https://schema.org",{"og:url":83,"og:type":124,"og:title":65,"og:site_name":95,"og:description":67},"article",{"robots":126,"canonical":83},"index,follow",{"doc_id":128,"site_id":62},681160,1793940543,{"code":4,"msg":5,"data":131},{"doc_id":128,"user_id":132,"nickname":92,"user_avatar":133,"doc_module":4,"category_id":29,"category_name":30,"doc_title":65,"doc_description":67,"doc_content":134,"file_id":135,"file_url":136,"file_type":137,"file_size":138,"view_count":19,"is_deleted":4,"is_public":8,"is_downloadable":8,"audit_status":8,"page_count":139,"language":140,"language_code":63,"site_id":62,"html_lang":63,"table_of_contents":141,"faqs":142,"seo_title":143,"seo_description":67,"update_tm":129,"read_time":144,"preview_page_count":19,"preview_urls":145},687208528416,"https://ap-avatar.wpscdn.com/davatar_9964176cb1d06d4a9deccf72a44ae3dc","6.170 Tutorial 2 Rails Basics  \nPrerequisites  \n1. RoR Installed and “Hello World” app from P0 working.  \n2. Familiarity with “Separation of Concerns” and M V C Controller.  \n3. Some knowledge of databases is useful but not necessary.  \nGoals of this Tutorial  \nGet familiar with the some basics of development using Ruby on Rails.  \nTutorial  \nNote: Read the README. rdoc file of your app. It has some very useful information for developing and debugging Rails apps. You’ll also find a lot of useful guides from [http://guides.rubyonrails.org/index.html](http://guides.rubyonrails.org/index.html).  \nYou Must Have Already Figured:  \n1. What is Ruby on Rails?  \na. A framework for rapid web based development using the Ruby language  \nb. A community of passionate developers and contributors.  \n2. What features does it provide?  \na. Clean Separation of concerns: Model View Controller.  \nb. Rapid web based software development and testing.  \nc. Rapid DB Access and Migrations without knowing many details of databases.  \nd. rake, a “make” system for Ruby for automating repetitive tasks.  \ne. Excellent software testing tools details will be covered in a future recitation.  \nf. A vibrant community of developers and contributors who make life easy for you.  \n3. What is Heroku? What features does it provide?  \na. A cool hosting service for RoR apps makes deploying and running complete RoR applications very easy.  \nb. Is based on Amazon EC2 infrastructure; allows dynamic provisioning of web servers, and backend servers.  \n4. What is Git? GitHub?  \na. Git is an awesome source control system and GitHub is an online service for easy creation and sharing of Git repositories.  \nTopic \\#0: Useful commands when developing rails applications  \n“rails” command provides many useful scripts for auto code generation etc. Examples:  \n$ rails [command] [args]  \n$ rails new \u003Cproject>  \n$ rails generate \u003Casset | model | resource etc .> \u003Cparameters>  \n$ rails destroy \u003Casset | model | resource etc .> \u003Cparameters>  \n“rake” is Ruby’s make system. Many useful development tasks come included as rake tasks Examples:  \n$ rake -T  \n$ rake db:setup ; rake db:migrate ; rake db:drop:all $ rake test ; rake test:uncommitted  \nNote: Many common tasks come built-in with rails but you can always develop custom rake tasks to automate your own work.  \nTopic \\#1: Routing in Rails  \nThe material in this section is adapted from: [http://guides.rubyonrails.org/routing.html](http://guides.rubyonrails.org/routing.html)[ ](http://guides.rubyonrails.org/routing.html)[Also see documentation in your](Also see documentation in your routes.rb file)[ routes.rb](Also see documentation in your routes.rb file)[ file](Also see documentation in your routes.rb file)  \nRails Router  \n1. Maps a URI to methods in controllers  \na. Example: post \"home/login\" => \"home\\#login\"  \n2. Utility methods for generating paths and URLs-no hard-coding of URLs  \n3. Routing specified in config/routes. rb config file  \nTwo kinds of Routing in Rails  \n1. Resourceful Routing: Shorthand for resources  \n2. Non-Resourceful Routing: For all other routing  \nResourceful Routing Examples  \nAt the command line in your app directory:  \n$ rails generate resource book title:string author:string price:number  \nCheck config/routes .rb file for:  \nresources :books  \nThis creates seven different routes in your application, all mapping to the Books controller:  \n\n| [HTTP Verb](HTTP Verb) | Path | action | used for |\n| --- | --- | --- | --- |\n| GET | /books | index | display a list of all books |\n| GET | /books/new | new | return an HTML form for creating a new books |\n\n\n| POST | /books | create | create a new book |\n| --- | --- | --- | --- |\n| GET | /books/:id | show | display a specific book |\n| GET | /books/:id/edit | edit | return an HTML form for editing a book |\n| PUT | /books/:id | update | update a specific book |\n| DELETE | /books/:id | destroy | delete a specific book |\n\nIn your browser, go to [http://localhost:3000/books/new]","cbCaint7qBbj99tA","https://ap.wps.com/l/cbCaint7qBbj99tA","pdf",338310,13,"English","# Prerequisites\n# Goals of this Tutorial\n# Tutorial Overview\n# Topic #0: Useful commands when developing rails applications\n# Topic #1: Routing in Rails\n## Rails Router\n## Two kinds of Routing in Rails","[{\"question\":\"What are the prerequisites for Tutorial 2 Rails Basics?\",\"answer\":\"The tutorial requires RoR installed and a working “Hello World” app, familiarity with separation of concerns and MVC controller, and some database knowledge (useful but not necessary).\"},{\"question\":\"What does the “rails” command do in Rails development?\",\"answer\":\"The “rails” command provides scripts for auto code generation and other development tasks. Examples include creating a new project and generating assets, models, and resources.\"},{\"question\":\"What are the two kinds of routing described in Rails?\",\"answer\":\"Rails routing is described as resourceful routing (shorthand for resources) and non-resourceful routing (for all other routing), with examples of how each maps paths to controller actions.\"}]","6.170 Tutorial 2 Rails Basics - Topic 0 Useful commands when developing rails applications | PDF",33,[146,150,154,158],{"page_no":8,"url":147,"width":148,"height":149},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-18/dfc9102395f0c0af6f3d37794a8ab35f.webp",983,1272,{"page_no":14,"url":151,"width":152,"height":153},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-18/cf0d1dfd4c226417f4a53a1412daff89.webp",982,1270,{"page_no":81,"url":155,"width":156,"height":157},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-18/31347740f5b01ac905694d6950493d7d.webp",981,1269,{"page_no":19,"url":159,"width":160,"height":161},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-18/a30348b6c08cb8e41531d175c096a994.webp",980,1268,{"list":163,"token":66},[164,170,176,182,188,194,200,206,212,218],{"doc_id":165,"doc_title":166,"file_type":137,"home_preview_img_url":167,"slug":168,"view_count":29,"category_name":30,"create_tm":169},681163,"Learn Ruby on Rails For Web Development - Introduction","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229998653527/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796135159&Signature=j7i8GzF6mh1q9z2rE49Oh4YQ2oM%3D","learn-ruby-on-rails-for-web-development-introduction",1793940547,{"doc_id":171,"doc_title":172,"file_type":137,"home_preview_img_url":173,"slug":174,"view_count":19,"category_name":30,"create_tm":175},681167,"Ruby on Rails Notes - For Professionals","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229998653572/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796135159&Signature=LNJdC58f7tzJndp0DNCBzb7T03s%3D","ruby-on-rails-notes-for-professionals",1793940557,{"doc_id":177,"doc_title":178,"file_type":137,"home_preview_img_url":179,"slug":180,"view_count":29,"category_name":30,"create_tm":181},681165,"Ruby on rails: The new GEM of web development - Introduction - Advantages of RoR framework - Architecture","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229997883788/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796135159&Signature=cegmrpfm2bb88RdFQptWYMD1tII%3D","ruby-on-rails-the-new-gem-of-web-development-introduction-advantages-of-ror-framework-architecture",1793940554,{"doc_id":183,"doc_title":184,"file_type":137,"home_preview_img_url":185,"slug":186,"view_count":81,"category_name":30,"create_tm":187},681164,"SWT2_03_Ruby on Rails - Introduction to Ruby on Rails","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229997883762/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796135159&Signature=i3hz9iaFvRafg0fgBUGTb7Xv7AQ%3D","swt2_03_ruby-on-rails-introduction-to-ruby-on-rails",1793940553,{"doc_id":189,"doc_title":190,"file_type":137,"home_preview_img_url":191,"slug":192,"view_count":81,"category_name":30,"create_tm":193},681166,"The Rails 4 Way - Part 4 - Working with Active Record","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229997883797/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796135159&Signature=Sq1SRV31ROD5yUxVldw%2FaojsT8g%3D","the-rails-4-way-part-4-working-with-active-record",1793940556,{"doc_id":195,"doc_title":196,"file_type":137,"home_preview_img_url":197,"slug":198,"view_count":24,"category_name":30,"create_tm":199},673339,"Learn Ruby on Rails: Book One - Version 4.0.0 - 25 November 2016","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229990522753/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796135159&Signature=K3qHfnr2FhmwrSTB7JHxUgDQksA%3D","learn-ruby-on-rails-book-one-version-400-25-november-2016",1793630696,{"doc_id":201,"doc_title":202,"file_type":137,"home_preview_img_url":203,"slug":204,"view_count":34,"category_name":30,"create_tm":205},681168,"Ruby on Rails Tutorial - Second Edition - Learn Web Development with Rails","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229998653631/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796135159&Signature=9p3SghZgDG2zaM6Z2cEaAmn4nfI%3D","ruby-on-rails-tutorial-second-edition-learn-web-development-with-rails",1793940560,{"doc_id":207,"doc_title":208,"file_type":137,"home_preview_img_url":209,"slug":210,"view_count":81,"category_name":30,"create_tm":211},686591,"Tutorial 3 - PostgreSQL","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230001041934/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796135159&Signature=zZDbwywQfJ6GYkgeR3S8hgVa8zQ%3D","tutorial-3-postgresql",1794057380,{"doc_id":213,"doc_title":214,"file_type":137,"home_preview_img_url":215,"slug":216,"view_count":19,"category_name":30,"create_tm":217},681162,"Introduction to Ruby on Rails Development - Part 3 - Intro","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229998653470/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796135159&Signature=t%2BKSRAy92qFezm2u2MwgVgBrLS0%3D","introduction-to-ruby-on-rails-development-part-3-intro",1793940546,{"doc_id":219,"doc_title":220,"file_type":137,"home_preview_img_url":221,"slug":222,"view_count":81,"category_name":30,"create_tm":223},673335,"THE BOOK OF RUBY - Introduction - Getting Started With Ruby - How to Read This Book","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229990730323/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796135159&Signature=SKF9JK4tT%2BaMXvU%2BJ4RcN7GBYXI%3D","the-book-of-ruby-introduction-getting-started-with-ruby-how-to-read-this-book",1793630685]