2017-07-26 70 views
0

隨着ActiveAdmin,你可以有一個attributes_table,如如何在2列或更多列中顯示Ruby ActiveAdmin attributes_table行?

show do 
    attributes_table do 
     row :name 
     row :gender 
     row :email 
     row :phone_number 
    end 
end 

你將有一個桌子和一幫行,如下所示:

Name    Joe Smith 
Gender   Male 
Email    [email protected] 
Phone Number  07722123456 

生成的HTML看起來像

<table> 
    <tbody> 
     <tr class="row row-name"> 
      <th>Name</th> 
      <td>Joe Smith</td> 
     </tr> 
     <tr class="row row-name"> 
      <th>Gender</th> 
      <td>Male</td> 
     </tr> 
     <tr class="row row-name"> 
      <th>Email</th> 
      <td>[email protected]</td> 
     </tr> 
     <tr class="row row-name"> 
      <th>Phone Number</th> 
      <td>07722123456</td> 
     </tr> 
    </tbody> 
</table> 

我想顯示這些屬性的2列,如

Name  Joe Smith     Gender   Male 
Email  [email protected]  Phone Number 07722123456 

如何通過ActiveAdmin輕鬆實現這一目標?

感謝

回答