form tags in rails code example
Example 1: form feild rails helper
<%= form_tag("/search", method: "get") do %>
<%= label_tag(:q, "Search for:") %>
<%= text_field_tag(:q) %>
<%= submit_tag("Search") %>
<% end %>
Example 2: rails form_tag
form_tag('/posts')
form_tag('/posts/1', method: :put)
form_tag('/upload', multipart: true)
<%= form_tag('/posts') do -%>
<div><%= submit_tag 'Save' %></div>
<% end -%>
# => <form action="/posts" method="post"><div><input type="submit" name="commit" value="Save" /></div></form>
<%= form_tag('/posts', remote: true) %>
# => <form action="/posts" method="post" data-remote="true">
form_tag('http://far.away.com/form', authenticity_token: false)
form_tag('http://far.away.com/form', authenticity_token: "cf50faa3fe97702ca1ae")