form_tag
http://blog.csdn.net/chunyang_guo/article/details/12779765
- 有对应 Model 的时候用 form_for,没有就用 form_tag,比如搜索框一般没有对应 Model。
- <%= form_tag controller: "static_pages", action: "change", method: "post" do %>
- <label for="oldpassword">Old Password</label><br>
- <%= password_field_tag :old_password,params[:old_password] %><br>
- <label for="new_password">New Password</label><br>
- <%= password_field_tag :new_password,params[:new_password] %><br>
- <label for="Password Confirm">Password Confirm</label><br>
- <%= password_field_tag :password_confirm, params[:password_confirm] %><br>
- <%= submit_tag 'Change Password' %>
- <% end %>