rails设计活动管理员从仪表板为不同的用户mdel添加用户

时间:2018-02-05 17:48:44

标签: ruby-on-rails devise activeadmin

我正在尝试在活动管理模块中添加用户模型。在这里,我使用Devise gem进行用户注册。这里我的用户表和管理员用户是不同的

我创建了一个名为users.rb的活动管理资源,其中我想添加或编辑用户密码,但是它以纯文本格式保存。这是我的活动管理资源users.rb:

<?php   
     $file = fopen("Incident_List.csv","r");

     echo "{<br>";
     echo "\"type\": \"FeatureCollection\",<br>";
     echo "\"features\": [<br>";

    $csvflag = true;
    while(! feof($file))
      {
      while (($data = fgetcsv($file)) !== FALSE) {
        if($csvflag) { $csvflag = false; continue; }
        echo "{<br>";
            echo "\"geometry\": {<br>";
            echo "\"type\": \"Point\",<br>";
            echo "\"coordinates\": [<br>";
        echo $data[2] . "," . $data[1] . "<br>";
        echo "]<br>";
        echo "},<br>";
        echo "\"type\": \"Feature\",<br>";
            echo "\"properties\": {<br>";
            echo "\"Category\":\"" . $data[4] . "\",<br>";
            echo "\"Grid Reference\":\"" . $data[0] . "\",<br>";
            echo "\"Day\":\"" . $data[3] . "\",<br>";
            echo "\"Date\":\"" . $data[4] . "\",<br>";
            echo "\"Type Of Incident\":\"" . $data[5] . "\",<br>";
            echo "\"Area\":\"" . $data[7] . "\",<br>";
            echo "\"Sex\":\"" . $data[8] . "\",<br>";
            echo "\"Age\":\"" . $data[9] . "\",<br>";
            echo "\"Members\":\"" . $data[10] . "\",<br>";
            echo "\"Hours\":\"" . $data[11] . "\",<br>";
            echo "\"Notes\":\"" . $data[12] . "\",<br>";
            echo "}<br>";
            echo "},<br>";

    }       

      }
    fclose($file);
      ?>

如何添加设计用户并在活动管理仪表板中编辑它们密码以纯文本格式保存,我需要在哪里进行更改。

0 个答案:

没有答案