mirror of
https://github.com/fspc/bike-database.git
synced 2026-09-16 16:41:38 -04:00
Louis | mild refactorings, add name method to bike
This commit is contained in:
@@ -50,8 +50,7 @@
|
||||
= f.text_field :completion_date, class: "form-control datepicker", disabled: disabled
|
||||
|
||||
.form-group
|
||||
= f.label "Type:", class: "col-sm-2 control-label"
|
||||
= f.label "Bike:", class: "col-sm-2 control-label"
|
||||
.col-sm-10
|
||||
= f.select(:bike_id, Bike.all.collect {|b| [ b.model, b.id ] }, {include_blank: 'None'})
|
||||
|
||||
= f.select(:bike_id, Bike.all.collect {|b| [ b.name, b.id ] }, {include_blank: 'None'})
|
||||
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
.container
|
||||
= form_for @client, html: {class: 'form-horizontal'} do |f|
|
||||
- if @client.errors.any?
|
||||
#error_explanation
|
||||
%h2= pluralize(@client.errors.count, "error") + " prohibited this bike from being saved:"
|
||||
%ul
|
||||
- @client.errors.full_messages.each do |msg|
|
||||
%li= msg
|
||||
= render 'fields', f: f
|
||||
.row
|
||||
.actions.col-sm-offset-2
|
||||
= f.submit class: "btn btn-default"
|
||||
= form_for @client, html: {class: 'form-horizontal'} do |f|
|
||||
- if @client.errors.any?
|
||||
#error_explanation
|
||||
%h2= pluralize(@client.errors.count, "error") + " prohibited this bike from being saved:"
|
||||
%ul
|
||||
- @client.errors.full_messages.each do |msg|
|
||||
%li= msg
|
||||
= render 'fields', f: f
|
||||
.row
|
||||
.actions.col-sm-offset-2
|
||||
= f.submit class: "btn btn-default"
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
%h1 New Client
|
||||
= render 'form'
|
||||
= link_to 'Back', clients_path
|
||||
.container
|
||||
%h1 New Client
|
||||
= render 'form'
|
||||
= link_to 'Back', clients_path
|
||||
|
||||
Reference in New Issue
Block a user