Ruby JavaScript Classes

M

Mike Stephens

Rails has JavascriptHelper but can you recommend other packages that
make it easy for the Ruby programmer to create JavaScript on web pages?
 
B

Brian Candler

Mike said:
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.
 
R

Rüdiger Bahns

Brian said:
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.
 
F

Fabian Streitel

[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:
(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!
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top