We will now perform all the CRUD operations on contacts. This means we will add, read, update, and delete the contact of our device from the Rhodes application.
Follow these steps:
Create a model contacts using the
rhogen
command:rhogen model contacts first_name, last_name, mobile_number, home_number, business_number, email_address, company_name
You will get the following output:
Generating with model generator: [ADDED] app/Contacts/index.erb [ADDED] app/Contacts/edit.erb [ADDED] app/Contacts/new.erb [ADDED] app/Contacts/show.erb [ADDED] app/Contacts/index.bb.erb [ADDED] app/Contacts/edit.bb.erb [ADDED] app/Contacts/new.bb.erb [ADDED] app/Contacts/show.bb.erb [ADDED] app/Contacts/contacts_controller.rb [ADDED] app/Contacts/contacts.rb [ADDED] app/test/contacts_spec.rb
Open the
contacts_controller.rb
file in theContacts
folder generated by therhogen
command and update the following...