ooops. sorry. should be

@myhash.collect {|k,v| "<li>#{k} is #{v}</li>"}.join

On Wed, Feb 16, 2011 at 8:19 AM, Jim Ruther Nill <jvn...@gmail.com> wrote:

> can't you use collect? and then join the result?
>
> @myhash.each {|k,v| "<li>#{k} is #{v}</li>"}.join
>
>
> On Wed, Feb 16, 2011 at 12:46 AM, Paul Bergstrom <li...@ruby-forum.com>wrote:
>
>> Why does this output the same hash again (like hash.inspect) and not
>> each key as I want?
>>
>> @myhash.each { |k,v| "<li>" + k + "</li>" }
>>
>> --
>> 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+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/rubyonrails-talk?hl=en.
>>
>>
>
>
> --
> -------------------------------------------------------------
> visit my blog at http://jimlabs.heroku.com
>



-- 
-------------------------------------------------------------
visit my blog at http://jimlabs.heroku.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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to