Skip to content

Instantly share code, notes, and snippets.

@mtparet
Created February 15, 2012 15:11
Show Gist options
  • Save mtparet/1836536 to your computer and use it in GitHub Desktop.
Save mtparet/1836536 to your computer and use it in GitHub Desktop.
#je récupère un objet "sequence" qui a de multiples "sequence_liste"
@sequence = Sequence.where(:name => params[:sequence_name]).first
sequence_listes = @sequence.sequence_liste.order("order_sequence")
#ici je veux un tableau de string de image.name de chaque sequence_liste
tab_ordered = sequence_listes.each { |i| i.image.name}
#et ensuite je compte le transférer dans mon code javascript
tab_correct = <%= array_or_string_for_javascript(@tab_correct) %>;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment