Felipe Pieretti Umpierre wrote in post #1046832:

Maybe you wanted....
emails_controller.rb @a = []
emails.each do |e|

for_each_one = e.split( "," )
@a << for_each_one

Append split array to @a array. (i.e. an array of arrays).
#@email.name = for_each_one[ 0 ]
#@email.email = for_each_one[ 1 ]
#@email.save
#
#if @email.valid?
# @group.emails << @email
#end

end

action

<% @a.each do |a| %>
<%= a[0], a[1] %><br />
The .each here would yield the two arrays contained within the outer
array.
<% end %>

return :

myemail@second.com
My Name

Thank you.
I'm not sure if that's exactly what you wanted, but should point you in
the right direction.

--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 3 of 5 | next ›
Discussion Overview
grouprubyonrails-talk @
categoriesrubyonrails
postedFeb 15, '12 at 1:58a
activeFeb 15, '12 at 3:03p
posts5
users1
websiterubyonrails.org
irc#RubyOnRails

1 user in discussion

Robert Walker: 5 posts

People

Translate

site design / logo © 2021 Grokbase