blob: e661fbb04ad058ceb67862f87f23baa8a7fb6c1c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
class LineReferentialsController < ChouetteController
defaults :resource_class => LineReferential
def show
show! do
@line_referential = LineReferentialDecorator.decorate(@line_referential)
end
end
def sync
authorize resource, :synchronize?
@sync = resource.line_referential_syncs.build
if @sync.save
flash[:notice] = t('notice.line_referential_sync.created')
else
flash[:error] = @sync.errors.full_messages.to_sentence
end
redirect_to resource
end
protected
def begin_of_chain
current_organisation
end
def line_referential_params
params.require(:line_referential).permit(:sync_interval)
end
end
|