mirror of
https://github.com/Retrospring/retrospring.git
synced 2025-03-15 23:50:02 +01:00
the new answer is now shown
This commit is contained in:
parent
9dc98a3e4e
commit
f53ca1b449
3 changed files with 9 additions and 5 deletions
|
@ -27,8 +27,7 @@ $(document).on "click", "button#q-answer", ->
|
|||
success: (data, status, jqxhr) ->
|
||||
if data.success
|
||||
$("div#q-answer-box").slideUp()
|
||||
# TODO:
|
||||
# ($ "div#q-answer-box").prepend data.render
|
||||
($ "div#answers").prepend data.render
|
||||
showNotification data.message, data.success
|
||||
error: (jqxhr, status, error) ->
|
||||
console.log jqxhr, status, error
|
||||
|
|
|
@ -38,10 +38,14 @@ class Ajax::AnswerController < ApplicationController
|
|||
services = JSON.parse params[:share]
|
||||
ShareWorker.perform_async(current_user.id, answer.id, services)
|
||||
|
||||
|
||||
@status = :okay
|
||||
@message = "Successfully answered question."
|
||||
@success = true
|
||||
@render = render_to_string(partial: 'shared/answerbox', locals: { a: answer, show_question: false }) unless inbox
|
||||
unless inbox
|
||||
@question = 1
|
||||
@render = render_to_string(partial: 'shared/answerbox', locals: { a: answer, show_question: false })
|
||||
end
|
||||
end
|
||||
|
||||
def destroy
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
ago
|
||||
%p.answerbox--question-text= @question.content
|
||||
|
||||
#answers
|
||||
- @answers.each do |a|
|
||||
= render 'shared/answerbox', a: a, show_question: false
|
||||
|
||||
|
|
Loading…
Reference in a new issue