如何将 ajax link 添加到将触发功能的 ActiveAdmin 视图
how do add an ajax link to an ActiveAdmin view that will trigger a function
我知道如何将 link 添加到活动管理员。下面的代码添加 link:
row "Has Attended Orientation" do
link_to('Accept','#')
end
但我的要求是,当用户单击 Accept
时,它应该显示 select YES
或 NO
的选项卡。如果用户 selects YES
那么它应该触发一个函数。谁能帮助我,我该怎么做?
尝试添加这个,
link_to "Accept", { action: :<action name> }, method: :<get or post>, data: { confirm: '<Enter the message you want>' }
我在 <> 中添加了说明。请根据需要输入代码。
我知道如何将 link 添加到活动管理员。下面的代码添加 link:
row "Has Attended Orientation" do
link_to('Accept','#')
end
但我的要求是,当用户单击 Accept
时,它应该显示 select YES
或 NO
的选项卡。如果用户 selects YES
那么它应该触发一个函数。谁能帮助我,我该怎么做?
尝试添加这个,
link_to "Accept", { action: :<action name> }, method: :<get or post>, data: { confirm: '<Enter the message you want>' }
我在 <> 中添加了说明。请根据需要输入代码。