首页 > 代码库 > rails表单控件helper

rails表单控件helper

1、form加入HTML属性

<%= form_for(@device, :html => {:method=>"post", :id=>"form1", :name=>"form1", :target=>"__hidden_call"}) do |f| %>
<% form_for :person, @person, :url => { :action => "update" } %>

 2、link_to

<%= link_to "Issues", {:controller => "issue", :action => "index"}, {:onclick => "alert(1)"} %>