Louis | mild refactorings, add name method to bike

This commit is contained in:
Loos
2014-09-17 09:37:00 -04:00
parent 277abcb5c0
commit 47980d61b0
6 changed files with 36 additions and 40 deletions
+2 -3
View File
@@ -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'})
+11 -12
View File
@@ -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"
+4 -3
View File
@@ -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