How to integrate online editors into your own website on Ruby

    The integration examples are used to demonstrate document editors functions and the ways to connect Document Server to your own application. DO NOT USE these examples on your own server without PROPER CODE MODIFICATIONS! If you enabled any of the test examples, disable it before going for production.

    Please keep in mind the following security aspects when you are using test examples:

    • There is no protection of the storage from unauthorized access since there is no need for authorization.
    • There are no checks against parameter substitution in links, since the parameters are generated by the code according to the pre-arranged scripts.
    • There are no data checks in requests of saving the file after editing, since each test example is intended for requests only from ONLYOFFICE Document Server.
    • There are no prohibitions on using test examples from other sites, since they are intended to interact with ONLYOFFICE Document Server from another domain.

    Download and install (packaged as Document Server).

    See the detailed guide to learn how to install Document Server for Windows, , or for Docker.

    1. Download the archive with the Ruby example and unpack the archive:

      unzip Ruby\ Example.zip

    2. Change the current directory for the project directory:

      cd Ruby\ Example

    3. Install the dependencies:

      bundle install

    4. Edit the application.rb configuration file. Specify the name of your local server with the ONLYOFFICE Document Server installed.

      nano config/application.rb

      Edit the following lines:

    5. See the result in your browser using the address:

      http://localhost

      If you want to experiment with the editor configuration, modify the in the views\home\editor.html.erb file.

    In case the example and Document Server are installed on different computers, make sure that your server with the example installed has access to the Document Server with the address which you specify instead of documentserver in the configuration files. Make sure that the Document Server in its turn has access to the server with the example installed with the address which you specify instead of example.com in the configuration files.

    If you integrated the editors successfully the result should look like the on our site.