Skip to content

Instantly share code, notes, and snippets.

@jgautsch
Created July 2, 2013 01:52
Show Gist options
  • Save jgautsch/5906232 to your computer and use it in GitHub Desktop.
Save jgautsch/5906232 to your computer and use it in GitHub Desktop.
JS being in my html from the db
# THis is the controller action
def first_step
@payers = sorted_payers
end
private
def sorted_payers
@label1 = Payer.new(name: "<script>$( document ).ready(function() {alert( 'ready!' );});</script>")
end
# In first_step.html.erb
# NOTE: wmi_payer_id is a method on the Payer class that just returns the id
<%= select_tag "id_of_payer", options_from_collection_for_select(@payers, "wmi_payer_id", "name"), multiple: true, class: "span6" %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment