Class: CompletionKit::ImportsController
Constant Summary
ApplicationController::ONBOARDING_DISMISS_COOKIE
Instance Method Summary
collapse
Instance Method Details
#create ⇒ Object
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
# File 'app/controllers/completion_kit/imports_controller.rb', line 6
def create
content = uploaded_content
if content.blank?
flash.now[:alert] = "Paste or upload a promptfooconfig.yaml to import."
return render :new, status: :unprocessable_entity
end
@result = PromptfooImporter.call(content)
if @result.ok
render :create
else
flash.now[:alert] = @result.error
render :new, status: :unprocessable_entity
end
end
|
#new ⇒ Object
3
4
|
# File 'app/controllers/completion_kit/imports_controller.rb', line 3
def new
end
|