mirror of
https://github.com/rickbarrette/stopwatch.git
synced 2026-04-02 09:51:57 -04:00
time entry form fixes
- issue selection selects the project accordingly - issue / project selection updates available activities - move project / issue selector to top. more logical this way, since making a selection there may change the available activities
This commit is contained in:
@@ -73,6 +73,17 @@ class StopwatchTimersController < ApplicationController
|
||||
render json: @timer.to_json
|
||||
end
|
||||
|
||||
def update_form
|
||||
if id = params[:time_entry_id].presence
|
||||
@time_entry = TimeEntry.visible.find id
|
||||
else
|
||||
@time_entry = TimeEntry.new
|
||||
end
|
||||
@time_entry.safe_attributes = params[:time_entry]
|
||||
rescue ActiveRecord::RecordNotFound
|
||||
head 404
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def find_timer
|
||||
@@ -82,7 +93,6 @@ class StopwatchTimersController < ApplicationController
|
||||
|
||||
def find_time_entry
|
||||
@time_entry = time_entries.find params[:id]
|
||||
|
||||
end
|
||||
|
||||
def load_todays_entries
|
||||
|
||||
Reference in New Issue
Block a user