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:
parent
3e56f2eb19
commit
b30203b750
@ -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
|
||||
|
@ -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" }
|
||||
|
Loading…
x
Reference in New Issue
Block a user