mirror of
https://github.com/fspc/bike-database.git
synced 2026-09-16 16:41:38 -04:00
add scaffold & bike form
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
<%= form_for(@bike) do |f| %>
|
||||
<% if @bike.errors.any? %>
|
||||
<div id="error_explanation">
|
||||
<h2><%= pluralize(@bike.errors.count, "error") %> prohibited this bike from being saved:</h2>
|
||||
|
||||
<ul>
|
||||
<% @bike.errors.full_messages.each do |msg| %>
|
||||
<li><%= msg %></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<%= f.label "Bike Entry Date:" %>
|
||||
<%= f.text_field :entry_date %>
|
||||
<br>
|
||||
<%= f.label "Brand:" %>
|
||||
<%= f.text_field :brand %>
|
||||
<br>
|
||||
<%= f.label "Type:" %>
|
||||
<%= f.text_field :type %>
|
||||
<br>
|
||||
<%= f.label "Freecyclery?" %>
|
||||
<%= f.check_box :freecyclery %>
|
||||
<br>
|
||||
<%= f.label "Sale?" %>
|
||||
<%= f.check_box :sale %>
|
||||
<br>
|
||||
<%= f.label "Serial Number" %>
|
||||
<%= f.text_field :serial_number %>
|
||||
<br>
|
||||
<%= f.label "Notes" %>
|
||||
<%= f.text_area :notes %>
|
||||
<br>
|
||||
<%= f.label "Tag Info" %>
|
||||
<%= f.text_area :tag_info %>
|
||||
<br>
|
||||
<%= f.label "Repaired by:" %>
|
||||
<%= f.text_field :repaired_by %>
|
||||
<br>
|
||||
<%= f.label "Completion Date:" %>
|
||||
<%= f.text_field :completion_date %>
|
||||
<br>
|
||||
<%= f.label "Price" %>
|
||||
<%= f.text_field :price %>
|
||||
<br>
|
||||
|
||||
<div class="actions">
|
||||
<%= f.submit %>
|
||||
</div>
|
||||
<% end %>
|
||||
@@ -0,0 +1,6 @@
|
||||
<h1>Editing bike</h1>
|
||||
|
||||
<%= render 'form' %>
|
||||
|
||||
<%= link_to 'Show', @bike %> |
|
||||
<%= link_to 'Back', bikes_path %>
|
||||
@@ -0,0 +1,25 @@
|
||||
<h1>Listing bikes</h1>
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<% @bikes.each do |bike| %>
|
||||
<tr>
|
||||
<td><%= link_to 'Show', bike %></td>
|
||||
<td><%= link_to 'Edit', edit_bike_path(bike) %></td>
|
||||
<td><%= link_to 'Destroy', bike, method: :delete, data: { confirm: 'Are you sure?' } %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<br>
|
||||
|
||||
<%= link_to 'New Bike', new_bike_path %>
|
||||
@@ -0,0 +1,4 @@
|
||||
json.array!(@bikes) do |bike|
|
||||
json.extract! bike,
|
||||
json.url bike_url(bike, format: :json)
|
||||
end
|
||||
@@ -0,0 +1,5 @@
|
||||
<h1>New bike</h1>
|
||||
|
||||
<%= render 'form' %>
|
||||
|
||||
<%= link_to 'Back', bikes_path %>
|
||||
@@ -0,0 +1,4 @@
|
||||
<p id="notice"><%= notice %></p>
|
||||
|
||||
<%= link_to 'Edit', edit_bike_path(@bike) %> |
|
||||
<%= link_to 'Back', bikes_path %>
|
||||
@@ -0,0 +1 @@
|
||||
json.extract! @bike, :created_at, :updated_at
|
||||
Reference in New Issue
Block a user