0
我有一個的form_for標籤,我想在用戶狀態有條件的form_for標籤+ Rails3中
if the current user is not an admin I want the form to be :remote => true
if the current user is an admin I want the form to be a default form
這使其能夠:remote => true
的選擇是什麼,我想出了其沒出息的工作;(
<%= form_for @school, ((:remote => true) unless current_user.admin?) , :html => { :class => 'form-horizontal' } do |f| %>
可有一個人幫我
我在
ruby 1.9
Rails 3.2.x
在此先感謝