feat: display the current ET
This commit is contained in:
parent
705e7b1dc0
commit
6710137d9b
4 changed files with 23 additions and 9 deletions
|
@ -14,6 +14,7 @@ class InstanceController < ApplicationController
|
|||
|
||||
def show
|
||||
@instance = Instance.includes(:pops).find_by(public_id: show_instance_params)
|
||||
@forecast = Weather.forecast(@instance.zone.to_sym)
|
||||
end
|
||||
|
||||
def pop
|
||||
|
@ -23,7 +24,8 @@ class InstanceController < ApplicationController
|
|||
pop = Pop.new(instance_id: parent_instance.id, name: nm)
|
||||
if pop.save
|
||||
@instance = Instance.includes(:pops).find_by(public_id: instance_id)
|
||||
render partial: "list", locals: { instance: @instance }
|
||||
@forecast = Weather.forecast(@instance.zone.to_sym)
|
||||
render partial: "list", locals: { instance: @instance, forecast: @forecast }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -34,7 +36,8 @@ class InstanceController < ApplicationController
|
|||
if parent_instance.password == pwd
|
||||
Pop.delete_by(instance_id: parent_instance.id, name: nm)
|
||||
@instance = Instance.includes(:pops).find_by(public_id: instance_id)
|
||||
render partial: "list", locals: { instance: @instance }
|
||||
@forecast = Weather.forecast(@instance.zone.to_sym)
|
||||
render partial: "list", locals: { instance: @instance, forecast: @forecast }
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue