Radio button for enumerize in rails admin

igor_rb

I have enumerize field in my model. And Rails admin automatically create for this field dropdown input. Does it possible to create radio input instead dropdown ?

Muntasim

You can use partial to render that field. in rails_admin.rb inside model config:

field :<your_field> do
  partial "<your_field_partial>"  #app/views/rails_admin/main/<your_field_partial>  
                                  #You can use sub directory there as expected.
end

The partial: I am posting an example>>>

<%= form.hidden_field field.method_name %>
<% permission_array = @object.permissions.split(',') %>
<% Constant::ROLES.each do |role| %>
  <p class="permission_roles">
    <%= check_box_tag role, role, permission_array.include?(role) %> <span><%= role.humanize %></span>
  </p>
<% end %>

이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.

침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제

에서 수정
0

몇 마디 만하겠습니다

0리뷰
로그인참여 후 검토

관련 기사

분류에서Dev

How to check radio button with radio button value

분류에서Dev

Android Radio Button Animation

분류에서Dev

checking if a radio button is selected

분류에서Dev

If radio button is checked not running

분류에서Dev

using radio button with knockoutjs

분류에서Dev

Add button in the admin interface

분류에서Dev

Ruby on Rails radio_button_tag가 onclick 기능으로 중단되었습니다.

분류에서Dev

Rails radio_button_tag 여러 매개 변수를 보내는 방법

분류에서Dev

Java Radio button clear/deselect

분류에서Dev

PHP check if a radio button is clicked

분류에서Dev

radio button size - Firefox for Android

분류에서Dev

Android: center background of radio button

분류에서Dev

Radio button to change JCombo Data

분류에서Dev

Add class to selected radio button

분류에서Dev

Add class to selected radio button

분류에서Dev

getting multiple radio buttons in rails

분류에서Dev

rails_admin의 CKeditor

분류에서Dev

rails_admin의 CarrierWave

분류에서Dev

양식 제출시 데이터를 저장하기 위해 rails radio_button_tag를 어떻게 얻습니까?

분류에서Dev

Get the clicked radio button Id in the change event

분류에서Dev

Unable to select Radio button with Selenium (python)

분류에서Dev

Show div based on Radio Button (with POST)

분류에서Dev

jQuery uncheck radio button based on class

분류에서Dev

Show whether dynamic radio button is checked or not

분류에서Dev

Radio button in WPF Application selected but not visible

분류에서Dev

Disabled radio button in simple_form with an array

분류에서Dev

Radio button jQuery change doesn't work

분류에서Dev

iCheck library: value of selected radio button

분류에서Dev

Php form with radio button does not work