- case action_name - when :destroy rad.discussion().comment('##{@model.dom_id}').destroy(); - when :edit - form = js render('form', object: @model, locals: {form_action: update_path(@model, format: :js)}) rad.discussion().comment('##{@model.dom_id}').edit('#{form}'); - when :new - form = js render('form', object: @model, locals: {form_action: create_comment_path(format: :js)}) rad.discussion().anew('#{form}'); - when :create - html = js render('embedded', object: @model) rad.discussion().create("#{html}"); - when :update - html = js render('embedded', object: @model) rad.discussion().comment('##{@model.dom_id}').update('#{html}'); - else - must_be.never_called