Skip to content

Instantly share code, notes, and snippets.

View rsl's full-sized avatar
🏳️‍🌈
still a bad fish and free bird

Russell Norris rsl

🏳️‍🌈
still a bad fish and free bird
View GitHub Profile
get_values(form_elements_cache, question_element).inject(radio_buttons = "") do |radio_buttons, value_hash|
html_options[:id] = "#{id}_#{i += 1}"
html_options[:onclick] = select_answer_event if follow_ups
codes << {:id => html_options[:id], :code => value_hash[:code]}
unless question_element.export_column.blank?
cdc_attributes << {:id => html_options[:id], :export_conversion_value_id => value_hash[:export_conversion_value_id]}
end
selected_code = @object.radio_button_answer.include?(value_hash[:value]) ? value_hash[:code] : "" unless !selected_code.blank?
class PostsController < ApplicationController
# Automatically create the strong parameters required method
def PostsController.filter_parameters(options = {})
options[:for] = [options[:for]] if options[:for].is_a?(Symbol)
options[:for].each do |action_name|
define_method("#{action_name.to_s}_params") do
base = options[:require].keys.first
params.require(base).permit(*options[:require][base])
end