Fix issue json response for creating result table [SCI-8853] (#5768)

* Fix issue json resposnse for creating result table [SCI-8853]

* Fix linter errors [SCI-8853]

* Fix linter errors [SCI-8853]

* Fix issues when editing and updating results text/table for task [SCI-8853]

* Fix linter errors [SCI-8853]
This commit is contained in:
wandji 2023-07-14 11:30:36 +01:00 committed by GitHub
parent 5266fad02d
commit ebe1bd583f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 34 deletions

View file

@ -18,15 +18,9 @@ class ResultTablesController < ApplicationController
table: @table
)
respond_to do |format|
format.json {
render json: {
html: render_to_string({
partial: "new.html.erb"
})
}, status: :ok
}
end
render json: {
html: render_to_string({ partial: 'new', formats: :html })
}, status: :ok
end
def create
@ -57,9 +51,7 @@ class ResultTablesController < ApplicationController
respond_to do |format|
format.json {
render json: {
html: render_to_string({
partial: "edit.html.erb"
})
html: render_to_string({ partial: 'edit', formats: :html })
}, status: :ok
}
end
@ -98,9 +90,11 @@ class ResultTablesController < ApplicationController
}
format.json {
render json: {
html: render_to_string({
partial: "my_modules/result.html.erb", locals: {result: @result}
})
html: render_to_string(
partial: 'my_modules/result',
locals: { result: @result },
formats: :html
)
}, status: :ok
}
else

View file

@ -20,15 +20,9 @@ class ResultTextsController < ApplicationController
)
@result.build_result_text
respond_to do |format|
format.json {
render json: {
html: render_to_string({
partial: "new.html.erb"
})
}, status: :ok
}
end
render json: {
html: render_to_string({ partial: 'new', formats: :html })
}, status: :ok
end
def create
@ -55,15 +49,9 @@ class ResultTextsController < ApplicationController
end
def edit
respond_to do |format|
format.json {
render json: {
html: render_to_string({
partial: "edit.html.erb"
})
}, status: :ok
}
end
render json: {
html: render_to_string({ partial: 'edit', formats: :html })
}, status: :ok
end
def update
@ -110,7 +98,7 @@ class ResultTextsController < ApplicationController
format.json do
render json: {
html: render_to_string(
partial: 'my_modules/result.html.erb',
partial: 'my_modules/result',
locals: { result: @result },
formats: :html
)