Skip to content

Instantly share code, notes, and snippets.

@cuciferus
Created October 23, 2012 15:02
Show Gist options
  • Save cuciferus/3939271 to your computer and use it in GitHub Desktop.
Save cuciferus/3939271 to your computer and use it in GitHub Desktop.
create_table "drugs", :force => true do |t|
t.string "nume"
t.string "dci"
t.float "doza"
t.string "cod"
t.string "diagnostic"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
form:
<fieldset>
<%= f.label :dci, "DCI" %>
<%= f.collection_select :dci, Drug.order(:dci), :id, :dci %>
<%= f.label :nume, "Denumire comerciala" %>
<%= f.grouped_collection_select :drug_id, Drug.all, :dci, :dci, :nume, :id%>
<%= link_to "Sterge medicament din reteta", "#", class: "remove_fields" %>
</fieldset>
error:
undefined method `map' for "Metformin":String #where Metformin is a nume for the drug
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment