Ruby on Rails with Webix

Hi!

I am trying to create my first Webix app using Ruby on Rails as a server side.

Everything as usual:

  1. Welcome controller with index

  2. welcome#index as a root_path

  3. Application layout was modified accordingly to run Webix application

  4. User model with name and email attributes created. One record was created.

  5. Webix application skeleton was created


~~~js
webix.ui({
  rows: [
    {type:"header", template:"Webix Grid Test"},
    {cols: [
      {rows: [
        {template:"Tree", width: 250 },
        {view:"resizer"},
      ]},
      {view:"resizer"},
      {rows: [
        {
          view:"datatable",
          container:"grid",
          url:"rest->/users",
          datatype:"json"
        }
      ]}
     ]
    }
  ]
});
~~~

But I see no Users output unfortunately. What I am doing wrong?

You need to provide a config for datatable or set autoConfig attribute

          view:"datatable",
          autoConfig:true,  /* <- this one */
          container:"grid",
          url:"rest->/users",
          datatype:"json"

Hello Maksim,

Thanks for your assistance, but still doesn’t work :frowning:

Any help from Rails developers?

Sergey

Данных маловато, может файл json неправильного формата. У меня вот так удачно подгружается:
…, view:“datatable”, url: “server/history.php”, …
В отладчике браузера нужно просмотреть содержимое json.
Я начинал с примера: http://docs.webix.com/samples/40_serverside/03_php_custom/01_datatable_loading.html

Привет,

получаю JSON вот такого вида - [{“id":1,“name”:“User”,“email”:"me@me.com”,“url”:“http://localhost:3000/users/1.json”}]. Вроде привильная структура, судя по описанию http://docs.webix.com/api__datadriver_json_other.html