使用simple_form显示隐藏字段

时间:2015-04-08 00:35:21

标签: ruby-on-rails simple-form

我有一个隐藏的字段:

<%= f.input :authentication, label: 'Authentication Password', as: :hidden %>

我想在点击管理员单选按钮时显示隐藏字段:

<%= f.input :account_type , as: :radio_buttons, :checked => 'Student', collection: ['Student', 'Admin'], wrapper: :vertical_radio_and_checkboxes %>

我该怎么做?

我尝试过使用

$('#user_authentication').show();

但这不起作用。

1 个答案:

答案 0 :(得分:1)

删除为:隐藏并使用 加载DOM时$('#user_authentication').hide();

相关问题