Skip to content

Instantly share code, notes, and snippets.

@raarellano
Created December 17, 2013 22:16
Show Gist options
  • Save raarellano/8013600 to your computer and use it in GitHub Desktop.
Save raarellano/8013600 to your computer and use it in GitHub Desktop.
Submit Radio button with a remote form in a Rails 4 app.
= form_for(@edit_single_response, remote: true, authenticity_token: true, :html => {:class => 'form-horizontal form-for-responses'} ) do |f|
- question.response_options.each do |response_option|
.form-group
%label.radio
= f.radio_button :response_option_number, response_option.id, :onclick => '$(this).trigger("submit.rails")'
%span
=response_option.text
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment