Search
 
SCRIPT & CODE EXAMPLE
 

RUBY

rails form_tag

form_tag('/posts')
# => <form action="/posts" method="post">

form_tag('/posts/1', method: :put)
# => <form action="/posts/1" method="post"> ... <input name="_method" type="hidden" value="put" /> ...

form_tag('/upload', multipart: true)
# => <form action="/upload" method="post" enctype="multipart/form-data">

<%= 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 without authenticity token

form_tag('http://far.away.com/form', authenticity_token: "cf50faa3fe97702ca1ae")
# form with custom authenticity token
Comment

PREVIOUS NEXT
Code Example
Ruby :: ruby pluck 
Ruby :: ruby get decimal 
Ruby :: ruby if 
Ruby :: array string ruby 
Ruby :: ruby median find 
Ruby :: rails activerecord to hash 
Ruby :: ruby find method 
Ruby :: how to remove nested array brackets ruby 
Ruby :: array to hash ruby 
Ruby :: rails rescue puts error 
Ruby :: ruby iterate over strings 
Ruby :: rails g migration remove default 
Ruby :: ruby pry syntax 
Ruby :: pg_ctl: no database directory specified and environment variable PGDATA unset 
Ruby :: change namespace in rails route 
Ruby :: ruby number of week 
Ruby :: how to remove the first element in an array ruby 
Ruby :: rails string to html 
Ruby :: rails change database connection 
Ruby :: ! in ruby 
Ruby :: initialize hash with 0 value ruby 
Ruby :: Rudy control S 
Ruby :: ruby on rails freecodecamp 
Ruby :: how to know current schema database in rails 
Ruby :: ruby find frequency in array self.all 
Ruby :: add key and value to the beginning of a hash ruby 
Ruby :: rails run rake task 
R :: how to add random numbers randomly in a dataframe in r 
R :: how to match two time series in r 
R :: set row names in r 
ADD CONTENT
Topic
Content
Source link
Name
8+9 =