1
0
mirror of https://github.com/fspc/BikeShed-1.git synced 2025-02-28 08:43:23 -05:00

Allow user select bike worked when adding time

This commit is contained in:
Jason Denney 2014-04-19 16:48:10 -04:00
parent 3e56f2eb19
commit b30203b750
2 changed files with 6 additions and 3 deletions

View File

@ -1,7 +1,11 @@
class TimeEntriesController < AuthenticatedController
def new
@bikes = Bike.all.map{ |b| [b.to_s , b.id] }
if bike = current_user.bike
@bikes.unshift( [bike.to_s, bike.id] )
end
@bikes.unshift( ["Non-bike work", -1] )
end
def index

View File

@ -31,8 +31,7 @@
.control-group
.controls
%label
Worked on a bike?
%input{ type: "checkbox"}
= select_tag(:bike_brand_id, options_for_select(@bikes))
.control-group
.controls
%textarea{id: "work_description", placeholder: "Work description", class: "input-lg" }