Search
 
SCRIPT & CODE EXAMPLE
 

RUBY

rails check_box_tag

check_box_tag 'receive_email', 'yes', true
# => <input checked="checked" id="receive_email" name="receive_email" type="checkbox" value="yes" />

check_box_tag 'tos', 'yes', false, class: 'accept_tos'
# => <input class="accept_tos" id="tos" name="tos" type="checkbox" value="yes" />

check_box_tag 'eula', 'accepted', false, disabled: true
# => <input disabled="disabled" id="eula" name="eula" type="checkbox" value="accepted" />
Comment

checkbox tag in rails

<%= form_tag(medication_select_path, method: 'put', :id => 'medication-select') do %>
  <% @medications.each do |medication| %>
    <%= check_box_tag "medications[]", medication.id  -%>
  <% end %>
<% end %>
Comment

PREVIOUS NEXT
Code Example
Ruby :: how to get current month end date in ruby 
Ruby :: ruby deep merge 
Ruby :: FATAL: database does not exist rails 
Ruby :: how to format date and time in rails 
Ruby :: ruby if statement one line 
Ruby :: rails reset database 
Ruby :: ruby unshift method 
Ruby :: button submit rails with font awesome 
Ruby :: how to json into hash ruby 
Ruby :: print in ruby 
Ruby :: shopify: how to show percentage discount saved 
Ruby :: rails check routes in console 
Ruby :: rails array count occurrences of elements 
Ruby :: rails scope syntax 
Ruby :: how to get fields of a table in rails 
Ruby :: rust overwrite file 
Ruby :: insert element in array ruby 
Ruby :: ruby os command injection 
Ruby :: ruby on rails binding.pry 
Ruby :: ruby check if hash has method before calling it 
Ruby :: ruby method tap 
Ruby :: crashed" method=GET path="/" rails 
Ruby :: ruby do something x times 
Ruby :: ruby adding an item to a hash 
Ruby :: location of a string ruby 
Ruby :: bundle add cloudinary rails 
Ruby :: inverse of in rails 
Ruby :: send email rails c one line 
R :: r ggplot regression line 
R :: reverse row order dataframe R 
ADD CONTENT
Topic
Content
Source link
Name
6+4 =