bootstrap_flash with ajax rails -


how should bootstrap_flash working? create.js.erb

$('.errors').html("<%= j render 'common/errors', resource:@answer %>"); $('.answers').append("<%= j render @answer %>"); $('.notice_flash'). ????????? i've tryed replacewith(<%= bootstrap_flash%>) 

this standart slim layout

 .container   .row     .col-lg-12       .notice_flash                         = bootstrap_flash       = yield      

and controller

def create     @answer = @question.answers.new(answer_params)     @answer.user = current_user        flash.now[:notice] = "successfully created" if @answer.save               

end

in create.js.erb:

$('.notice_flash').html('<%= bootstrap_flash %>')


Comments