Add A New Job Form
Goals
Steps
Step 1: Visit /jobs/new
Error! Woo!!!
The action 'new' could not be found for JobsController
Step 2: add an action to the controller
def new @job = Job.new endError! Woo!!!
JobsController#new is missing a template for request formats: text/html
Step 3: create a view
<h1>Add a job</h1>Step 4: Add a form!
<%= form_with(model: @job, local: true) do |form| %> <div> <%= form.label :title %> <%= form.text_field :title %> </div> <div> <%= form.label :description %> <%= form.text_area :description, size: '60x6' %> </div> <div> <%= form.submit %> </div> <% end %>
Now would be a good time to commit to git
Discussion: Form HTML
Next Step:
Go on to Make The Form Work