[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"detail-sidebar-cat-0-en-105":3,"doc-seo-681169-105":59,"doc-detail-681169-en":130,"doc-similar-681169":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","depot-iteration-a1-creating-the-product-maintenance-application","Depot - Iteration A1 - Creating the Product Maintenance Application","","A step-by-step guide to building the Depot application, focusing on setting up the core database, installing and configuring SQLite, and preparing the environment to avoid common setup issues. It then walks through creating a Rails application with Tailwind CSS support, navigating directories and command-line workflow, and using Rails to generate a scaffold for the Product model with associated views, controllers, routes, tests, and Tailwind integration. It includes explanations of conventions and migration purpose.",{"@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/depot-iteration-a1-creating-the-product-maintenance-application/681169/",{"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/depot-iteration-a1-creating-the-product-maintenance-application/681169.png","ImageObject",300,407,{"name":92,"@type":93},"eBook King","Person",{"url":74,"name":95,"@type":96},"DocShare","Organization","application/pdf","2026-11-19","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 is the role of the database when building the Depot application?","Question",{"text":112,"@type":113},"The guide states that the Depot application is centered on a database. Installing, configuring, and testing it early helps prevent many setup problems.","Answer",{"name":115,"@type":110,"acceptedAnswer":116},"How do you create a Rails application that uses Tailwind CSS?",{"text":117,"@type":113},"Create the app with the Tailwind option during the rails new command, so the framework is enabled and affects development server startup.",{"name":119,"@type":110,"acceptedAnswer":120},"How does the scaffold generation relate to the Product model and products table?",{"text":121,"@type":113},"A scaffold command generates the model, views, controller, migration, routes, and tests. The guide explains Rails maps the Product model to the pluralized products table and uses configuration to locate it for SQLite.","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},681169,1793940561,{"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},962088006270,"https://ap-avatar.wpscdn.com/davatar_085a072bc5b1113ac321206ff7593b45","This extract shows the online version of this title, and may contain features (such as hyperlinks and colors) that are not available in the print version.  \nFor more information, or to purchase a paperback or ebook copy, please visit [https://www.pragprog.com](https://www.pragprog.com).  \nCopyright © The Pragmatic Programmers, LLC.  \nIteration A1: Creating the Product Maintenance Application  \nAt the heart of the Depot application is a database. Getting this installed and configured and tested before proceeding will prevent a lot of headaches. If you’re not certain about what you want, take the defaults, and it will go easily. If you know what you want, Rails makes it easy for you to describe your configuration.  \nFor this project, let’s make use of the Tailwind CSS 1 framework, which enables you to make pretty websites without authoring any CSS. We’ll do so by specifying an additional option when we create our application, and as you’ll shortly see it will also affect how we start our server during development.  \nCreating a Rails Application  \nIn Creating a New Application, on page ?  , you saw how to create a new Rails application. We’ll do the same thing here. Go to a command prompt and type rails new followed by the name of our project, and then add the option to make use of the Tailwind CSS framework. Here, our project is called depot , so make sure you’re not inside an existing application directory, and type this:  \nwork> rails new depot - -css tailwind  \nWe see a bunch of output scroll by. When it has finished, we find that a new directory, depot , has been created. That’s where we’ll be doing our work:  \nwork> cd depot  \ndepot> ls -p  \nDockerfile [README.md](README.md) config/ log/ test/  \nGemfile Rakefile [config. ru](config. ru) public/ tmp/  \nGemfile .lock app/ db/ script/ vendor/  \n[Procfile.dev](Procfile.dev) bin/ lib/ storage/  \nOf course, Windows users need to use dir /w instead of ls-p.  \nCreating the Database  \nFor this application, we’ll use the open source SQLite database (which you’ll need if you’re following along with the code). We’re using SQLite version 3 here.  \nSQLite 3 is the default database for Rails development and was installed along with Rails in Chapter 1, Installing Rails, on page ?. With SQLite 3, no steps are required to create a database, and we have no special user accounts or  \n1.  [https://tailwindcss.com/](https://tailwindcss.com/)  \n• 4  \npasswords to deal with. So now you get to experience one of the benefits of going with the flow (or, convention over configuration, as the Rails folks [say...ad](say...ad) nauseam) .  \nIf it’s important to you to use a database server other than SQLite 3, the commands to create the database and grant permissions will be different. You can find some helpful hints in the database configuration section of Configuring Rails Applications in the Ruby on Rails Guides.2  \nGenerating the Scaffold  \nBack in our initial guess at application data on page ?  , we sketched out the basic content of the products table. Now let’s turn that into reality. We need to create a database table and a Rails model that lets our application use that table, a number of views to make up the user interface, and a controller to orchestrate the application.  \nSo let’s create the model, views, controller, and migration for our products table. With Rails, you can do all that with one command by asking Rails to generatea scaffold for a given model. Note that on the command line that follows, we use the singular form, Product. In Rails, a model is automatically mapped to a database table whose name is the plural form of the model’s class. In our case, we ask for a model called Product , so Rails associates it with the table called products. (And how will it find that table? The development entry in config/database.yml tells Rails where to look for it. For SQLite 3 users, this’ll bea file in the storage directory.)  \nNote that the command is too wide to fit comfortably on the page. To e","cbCaitv3V0Yqx13N","https://ap.wps.com/l/cbCaitv3V0Yqx13N","pdf",1200960,11,"English","# Iteration A1: Creating the Product Maintenance Application\n## Creating a Rails Application\n## Creating the Database\n## Generating the Scaffold","[{\"question\":\"What is the role of the database when building the Depot application?\",\"answer\":\"The guide states that the Depot application is centered on a database. Installing, configuring, and testing it early helps prevent many setup problems.\"},{\"question\":\"How do you create a Rails application that uses Tailwind CSS?\",\"answer\":\"Create the app with the Tailwind option during the rails new command, so the framework is enabled and affects development server startup.\"},{\"question\":\"How does the scaffold generation relate to the Product model and products table?\",\"answer\":\"A scaffold command generates the model, views, controller, migration, routes, and tests. The guide explains Rails maps the Product model to the pluralized products table and uses configuration to locate it for SQLite.\"}]","Depot - Iteration A1 - Creating the Product Maintenance Application | PDF",28,[146,150,154,158],{"page_no":8,"url":147,"width":148,"height":149},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-18/aa641126131eb54386114916b36764b8.webp",983,1179,{"page_no":14,"url":151,"width":152,"height":153},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-18/ec17662831cd05e0459574833ab042a4.webp",982,1178,{"page_no":81,"url":155,"width":156,"height":157},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-18/1fae8a526e5b890fc600b611a5818e07.webp",981,1177,{"page_no":19,"url":159,"width":160,"height":161},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-18/5a20ed72330c45e5ec51c716c46d3117.webp",980,1175,{"list":163,"token":66},[164,170,177,183,189,196,202,208,214,221],{"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=1796157779&Signature=27sRBDeP8c9SYTmBXVCwK48ImwU%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":175,"category_name":30,"create_tm":176},673518,"Installation Guide - 2022 MS SQL Server on Ubuntu Linux (20.4)","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229990906935/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796157779&Signature=Q7QW9cYE%2Bk2SvaoIi%2FTsA7aol9A%3D","installation-guide-2022-ms-sql-server-on-ubuntu-linux-204",13,1793647486,{"doc_id":178,"doc_title":179,"file_type":137,"home_preview_img_url":180,"slug":181,"view_count":81,"category_name":30,"create_tm":182},760103,"Android Studio Flamingo Essentials - Java Edition","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230044495597/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796157779&Signature=X6VfEUGhdgce1X5CsWqNOEVbK9M%3D","android-studio-flamingo-essentials-java-edition",1795898554,{"doc_id":184,"doc_title":185,"file_type":137,"home_preview_img_url":186,"slug":187,"view_count":56,"category_name":30,"create_tm":188},489278,"NextJS - CSS Styling","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229926987254/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796157779&Signature=bDG%2FVA5q0qrtMiEDEjMeVPwSiH8%3D","nextjs-css-styling",1790821930,{"doc_id":190,"doc_title":191,"file_type":137,"home_preview_img_url":192,"slug":193,"view_count":194,"category_name":30,"create_tm":195},489290,"React JS Full Course E-book Content - Introduction to React - Course Outline","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229927222694/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796157779&Signature=nixt0FEe328ZAzZQoQDHxqDWJkU%3D","react-js-full-course-e-book-content-introduction-to-react-course-outline",16,1790822011,{"doc_id":197,"doc_title":198,"file_type":137,"home_preview_img_url":199,"slug":200,"view_count":56,"category_name":30,"create_tm":201},496817,"ASE-to-ASE Replication Quick Start Guide - 1.0","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229930179522/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796157779&Signature=ziWBr%2FpooRuQOVBYksXl9kncTpk%3D","ase-to-ase-replication-quick-start-guide-10",1790940544,{"doc_id":203,"doc_title":204,"file_type":137,"home_preview_img_url":205,"slug":206,"view_count":34,"category_name":30,"create_tm":207},687283,"15-122 - Principles of Imperative Computation - Setup Lab","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230001254678/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796157779&Signature=Vl2aU6HrPL53LFPpvyJ5JpBfukU%3D","15-122-principles-of-imperative-computation-setup-lab",1794082567,{"doc_id":209,"doc_title":210,"file_type":137,"home_preview_img_url":211,"slug":212,"view_count":81,"category_name":30,"create_tm":213},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=1796157779&Signature=ykmIXHN8YAl28XJWeRd8A1vyeg4%3D","the-rails-4-way-part-4-working-with-active-record",1793940556,{"doc_id":215,"doc_title":216,"file_type":137,"home_preview_img_url":217,"slug":218,"view_count":219,"category_name":30,"create_tm":220},647385,"Quick Setup Guide - UHD TV Installation","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229972324011/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796157779&Signature=TOi4H7zfSNZHvbIVOkB4EeNwRj8%3D","quick-setup-guide-uhd-tv-installation",15,1792788463,{"doc_id":222,"doc_title":223,"file_type":137,"home_preview_img_url":224,"slug":225,"view_count":39,"category_name":30,"create_tm":226},688940,"Parallels Client for Android User's Guide 18 - User's Guide","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230000671709/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796157779&Signature=%2BRUQICzYlyqqAOB40kay1vyGHX4%3D","parallels-client-for-android-users-guide-18-users-guide",1794092970]