|
From: Junkone on 1 Jul 2008 04:51 what is the meaning of %w. atlest in my copy of rubydoc, i could not find the w attribute in sprintf flag characters
From: Ryan Davis on 1 Jul 2008 05:08 On Jul 1, 2008, at 01:52 , Junkone wrote: > what is the meaning of %w. atlest in my copy of rubydoc, i could not > find the w attribute in sprintf flag characters %w doesn't have to do with sprintf afaik. Maybe you mean this instead: http://www.zenspider.com/Languages/Ruby/QuickRef.html#12
From: Junkone on 1 Jul 2008 05:21 On Jul 1, 5:08 am, Ryan Davis <ryand-r...(a)zenspider.com> wrote: > On Jul 1, 2008, at 01:52 , Junkone wrote: > > > what is the meaning of %w. atlest in my copy of rubydoc, i could not > > find the w attribute in sprintf flag characters > > %w doesn't have to do with sprintf afaik. > > Maybe you mean this instead: > > http://www.zenspider.com/Languages/Ruby/QuickRef.html#12 in rails, this is how it create the options for select box. <%= select(:rawdata, :symbol, %w{ AUD.USD-IDEALPRO-CASH EUR.GBP- IDEALPRO-CASH EUR.JPY-IDEALPRO-CASH EUR.USD-IDEALPRO-CASH GBP.USD- IDEALPRO-CASH USD.CAD-IDEALPRO-CASH USD.CHF-IDEALPRO-CASH }) %> what does the %w signify.
From: Frederick Cheung on 1 Jul 2008 05:27 On 1 Jul 2008, at 10:22, Junkone wrote: > On Jul 1, 5:08 am, Ryan Davis <ryand-r...(a)zenspider.com> wrote: >> On Jul 1, 2008, at 01:52 , Junkone wrote: >> >>> what is the meaning of %w. atlest in my copy of rubydoc, i could not >>> find the w attribute in sprintf flag characters >> >> %w doesn't have to do with sprintf afaik. >> >> Maybe you mean this instead: >> >> http://www.zenspider.com/Languages/Ruby/QuickRef.html#12 > > in rails, this is how it create the options for select box. > <%= select(:rawdata, :symbol, %w{ AUD.USD-IDEALPRO-CASH EUR.GBP- > IDEALPRO-CASH EUR.JPY-IDEALPRO-CASH EUR.USD-IDEALPRO-CASH GBP.USD- > IDEALPRO-CASH USD.CAD-IDEALPRO-CASH USD.CHF-IDEALPRO-CASH }) %> > > what does the %w signify. Exactly what the link Ryan posted says. It creates an array by splitting the string you give it. Fred
From: Peña, Botp on 1 Jul 2008 05:28 From: Junkone [mailto:junkone1(a)gmail.com] # what is the meaning of %w. atlest in my copy of rubydoc, i could not # find the w attribute in sprintf flag characters we may need a site search for ruby-doc, otherwise, nubies like me will have to look harder ;) look for references to "array" in this page http://www.ruby-doc.org/docs/ProgrammingRuby/html/language.html. you wont miss it. hth. kind regards -botp
|
Next
|
Last
Pages: 1 2 Prev: Hash#select returns an array but Hash#reject returns a hash... Next: Dynamic Variables |