mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-12-27 02:04:33 +08:00
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:
parent
5266fad02d
commit
ebe1bd583f
2 changed files with 16 additions and 34 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue