Irb with rails

I was trying to access rails functions (number_with_precision) from an
irb session.

It can’t find the method. How do I load the libraries ?

TIA
LS

Thanks Zed,
This is the error I got when I tried that.

p number_with_precision(1.2334,2)
NoMethodError: undefined method `number_with_precision’ for
#Object:0x27891f8
from (irb):1

Do I need to do a ‘require’ ?

Zed S. wrote:

Try this instead:

script/console

That’s basically what you want.

Zed

Try this instead:

script/console

That’s basically what you want.

Zed

On Thursday, February 23, 2006, at 7:25 AM, kevin wrote:

Thanks Zed,
This is the error I got when I tried that.

p number_with_precision(1.2334,2)
NoMethodError: undefined method `number_with_precision’ for
#Object:0x27891f8
from (irb):1

Do I need to do a ‘require’ ?

Yeah, i believe its in one of the helpers…

Mikkel B.

www.strongside.dk - Football Portal(DK)
nflfeed.helenius.org - Football News(DK)
ting.minline.dk - Buy Old Stuff!(DK)

kevin wrote:

I was trying to access rails functions (number_with_precision) from an
irb session.

It can’t find the method. How do I load the libraries ?

TIA
LS

Using script/console:

ruby script\console
Loading development environment.

include ActionView::Helpers::NumberHelper
=> Object

number_with_precision(111.2345)
=> “111.235”

Using irb:

irb
irb(main):001:0> require ‘rubygems’
=> false
irb(main):002:0> require ‘initializer’
=> true
irb(main):003:0> include ActionView::Helpers::NumberHelper
=> Object
irb(main):004:0> number_with_precision(111.2345)
=> “111.235”

Simo
Addsw.it

Wow, I tried and gave up - got everything but the “require
‘initializer’”

Thanks.

Simo Gal wrote:

kevin wrote:

I was trying to access rails functions (number_with_precision) from an
irb session.

It can’t find the method. How do I load the libraries ?

TIA
LS

Using script/console:

ruby script\console
Loading development environment.

include ActionView::Helpers::NumberHelper
=> Object

number_with_precision(111.2345)
=> “111.235”

Using irb:

irb
irb(main):001:0> require ‘rubygems’
=> false
irb(main):002:0> require ‘initializer’
=> true
irb(main):003:0> include ActionView::Helpers::NumberHelper
=> Object
irb(main):004:0> number_with_precision(111.2345)
=> “111.235”

Simo
Addsw.it

nice

Mikkel B.

www.strongside.dk - Football Portal(DK)
nflfeed.helenius.org - Football News(DK)
ting.minline.dk - Buy Old Stuff!(DK)