我想在一些标准操作上调用部分。我正在使用这种方法来调用部分:
%li= link_to 'Delete Event', 'javascript:void(0);', :class => 'alert tiny button', :data => {'reveal-id' => :RevealDelete}
= render 'layouts/reveal_delete', :item => event_display(@event.event), :resource => @event
然后在我的部分,
#RevealDelete.reveal-modal
%a.close-reveal-modal ×
%h3= "Delete #{item}"
%p Are you sure you want to delete this?
=link_to "Delete #{item}", resource, :method => :delete, :remote => :true, :confirm => resource, :class => 'button close-reveal-modal'
%a.button.alert.close-reveal-modal Cancel
我怎么能有这样的东西:
link_to 'Delete', '#', :partial => 'layouts/delete', :remote => :true?
这样我只在单击而不是在页面加载时呈现该部分?