Ruby JavaScript Classes

Discussion in 'Ruby' started by Mike Stephens, Sep 2, 2009.

  1. Rails has JavascriptHelper but can you recommend other packages that
    make it easy for the Ruby programmer to create JavaScript on web pages?
    --
    Posted via http://www.ruby-forum.com/.
    Mike Stephens, Sep 2, 2009
    #1
    1. Advertising

  2. Mike Stephens wrote:
    > Rails has JavascriptHelper but can you recommend other packages that
    > make it easy for the Ruby programmer to create JavaScript on web pages?


    I suggest you write native Javascript using jQuery - you'll be glad you
    did. jQuery lets you work at the level of CSS selectors, e.g.

    $('.someclass').hide(); // hide all elements with class someclass

    The half-way house: install jRails and then the Rails helpers will
    output jQuery instead of Prototype.
    --
    Posted via http://www.ruby-forum.com/.
    Brian Candler, Sep 2, 2009
    #2
    1. Advertising

  3. Brian Candler schrieb:
    > I suggest you write native Javascript using jQuery - you'll be glad you
    > did. jQuery lets you work at the level of CSS selectors, e.g.
    >
    > $('.someclass').hide(); // hide all elements with class someclass


    The same with Prototype looks like this:

    $$('.someclass').invoke('hide');

    jQuery is not as much better than Prototype as many people believe that
    just don't know Prototype.

    In the german JS-newsgroup the one and only answer to the question
    'which JS-framework should I use?' is 'write your own. The existing ones
    are all bullshit'...

    R.
    Rüdiger Bahns, Sep 2, 2009
    #3
  4. [Note: parts of this message were removed to make it a legal post.]

    I can recommend Prototype as well.

    Also, there's this great talk by a person who KNOWS about JS:
    http://www.youtube.com/watch?v=hQVTIJBZook
    (I know it's an hour long, but I really took some lessons out of it. I think
    it's worth the time investment)

    and his great tool:
    http://www.jslint.com
    that helped me remove a lot of errors from my javascript stuff...


    In the german JS-newsgroup the one and only answer to the question 'which
    > JS-framework should I use?' is 'write your own. The existing ones are all
    > bullshit'...
    >


    I like that one ;-)

    There are tons of frameworks out there, just pick one that has the kind of
    syntactic sugar you favor...
    Greetz!
    Fabian Streitel, Sep 3, 2009
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. David

    Classes within classes

    David, Jul 21, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    4,939
    David
    Jul 22, 2005
  2. lonelyplanet999
    Replies:
    1
    Views:
    2,210
    VisionSet
    Nov 13, 2003
  3. Carfield Yim
    Replies:
    1
    Views:
    1,416
    Andrew Thompson
    May 31, 2004
  4. John Carter
    Replies:
    1
    Views:
    125
  5. snacktime
    Replies:
    1
    Views:
    114
    Nobuyoshi Nakada
    Sep 20, 2006
Loading...

Share This Page