app/controllers/documents_v2_controller.rb
def launch
    @document = Document.find_by(id: params[:id])
    @codap_server = launch_params[:server]

    @button_url = codap_v2_link(@codap_server)
    @button_text = launch_params[:buttonText] || 'Launch'

    @in_a_window = launch_params[:window] == 'true'

    @copy_shared_url = v2_document_create_url(source: params[:id])
    @reset_url = v2_document_save_url(id: 'RESET_ID', source: params[:id], accessKey: 'RW::ACCESS_KEY')  # RESET_ID and ACCESS_KEY are replaced with the document info in the interactive state in the launch view javascript

    authorize! :open, :url_document
    response.headers.delete 'X-Frame-Options'
    render layout: 'launch'
  end
# don't check for csrf token
don't check for csrf token
don ' t check for csrf token
def launch
    @document = Document.find_by(id: params[:id])
    @codap_server = launch_params[:server]
    @button_url = codap_v2_link(@codap_server)
    @button_text = launch_params[:buttonText] || 'Launch'
    @in_a_window = launch_params[:window] == 'true'
    @copy_shared_url = v2_document_create_url(source: params[:id])
    @reset_url = v2_document_save_url(id: 'RESET_ID', source: params[:id], accessKey: 'RW::ACCESS_KEY')  
    authorize! :open, :url_document
    response.headers.delete 'X-Frame-Options'
    render layout: 'launch'
  end
def launch @document = Document . find_by ( id : params [ :id ] ) @codap_server = launch_params [ :server ] @button_url = codap_v2_link ( @codap_server ) @button_text = launch_params [ :buttonText ] || 'Launch' @in_a_window = launch_params [ :window ] == 'true' @copy_shared_url = v2_document_create_url ( source : params [ :id ] ) @reset_url = v2_document_save_url ( id : 'RESET_ID' , source : params [ :id ] , accessKey : 'RW::ACCESS_KEY' ) authorize! :open , :url_document response . headers . delete 'X-Frame-Options' render layout : 'launch' end
don't check for csrf token
don ' t check for csrf token
# RESET_ID and ACCESS_KEY are replaced with the document info in the interactive state in the launch view javascript