SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    Feb 2007
    Location
    Antwerp, Belgium
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Instant Rails => Ruby console window question

    Hello all,
    I'm a newbie when it comes to Ruby on Rails and I'm learning the language from the Sitepoint book 'Build your own Ruby on Rails web applications'.
    On page 65 there is an example of how to introduce Instance Variables.
    In the Interactive Ruby Shell (irb) in the Ruby console window one have to type : irb> class Car
    irb> @mileage = 0
    irb> end

    By using the @-symbol before mileage makes this an instance variable.

    Only, I don't seem to get that @-symbol into the Ruby console window.
    It looks like there is no reaction when I press [AltGr]+[key 2]?!?

    Does anyone know how to remedy this?
    Thanks alot.
    Dan

  2. #2
    SitePoint Member
    Join Date
    Jan 2007
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You want to use [SHIFT + 2] for the '@' symbol. There is no need for the AltGr key.

    Good luck!

  3. #3
    SitePoint Member
    Join Date
    Feb 2007
    Location
    Antwerp, Belgium
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Cloretz,
    Thanks for the effort but it didn't work out. Maybe I should have mentionned that I have a French keyboard so on that particular key I can see : , above there is 2 and on the right of there is @. So when I use [Shift]+[key2] I simply get 2.
    It struck me that when I use the Ruby console as such, I can type in the @-symbol. It is just when I have typed the irb-command (the interactive Ruby Shell) - in this mode - my keyboard does not react the same and the [AltGr]+[Key2] combination doesn't work anymore!? It looks like the interactive ruby shell changes my keyboardmapping...

  4. #4
    SitePoint Guru
    Join Date
    Aug 2005
    Posts
    986
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Maybe you can copy & paste ;-).


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •