Dozerslist Create And Retrieve

Report 5 Downloads 90 Views
 

Create and Retrieve DIRECTIONS:​Follow along as you begin learning the basics of Ruby on Rails, a powerful framework for creating dynamic, data-driven websites. ❏

Login to Cloud9

● Go to ​ https://c9.io/web/login



Open Workspace

● Click OPEN on your ​ ruby-on-rails​ workspace tile



Make Sure Your Application is Running

● Change directory to ​ dozerslist​ ,​​ your application’s directory: $​ cd dozerslist

● Launch the Rails server: ​ $​ rails s -b $IP -p $PORT ❏

Create a New Record

● To add new records to the database, we will be creating a web form users can fill in and submit to post their items ● Since users will be using the ​ /items/new​ path to access the ​ new items web form (see figure below), we need to add a new​ action to our controller to handle these requests.

● To do so, update the ​ items_controller.rb​ file, adding an action (a.k.a. method) named ​ new​ : Page 1 of 9

class ​ ItemsController​​ Quit Cloud9

Page 9 of 9