jQuery vs Prototype re: Rails' helpers

14 views
Skip to first unread message

Bill Walton

unread,
Jan 6, 2011, 4:03:42 PM1/6/11
to rubyonra...@googlegroups.com
I'm considering switching from Prototype to jQuery but wonder... do
the Rails helper methods like form_remote_tag and button_to_remote
work with jQuery 'out of the box' ?

I've got 2 apps I'd need to convert: one on 2.1.1 and the other on 2.3.2

TIA,
Bill

Marnen Laibow-Koser

unread,
Jan 6, 2011, 4:07:48 PM1/6/11
to rubyonra...@googlegroups.com
Bill Walton wrote in post #972936:

I understand that the jRails plugin will do at least some of what you
want. But as you know, I think that Rails 2's JS helpers are anathema
and should never be used, because of the inline JS they create. This
might be a good time to drop them.

>
> TIA,
> Bill

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
mar...@marnen.org

--
Posted via http://www.ruby-forum.com/.

Ants Pants

unread,
Jan 6, 2011, 4:32:27 PM1/6/11
to rubyonra...@googlegroups.com
Aren't the remote helpers built with prototype?

Best thing I ever did was move away from Prototype. 


--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonra...@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-ta...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.


dsadaka

unread,
Jan 6, 2011, 10:30:35 PM1/6/11
to Ruby on Rails: Talk
If your converting to Rails 3, you'll need to change your code
anyway. There are no more remote-specific tags. Instead, the tag
names are the same as a normal action. Instead, you'll add a :remote
=> true.

So... while you're at it, I strongly suggest you change to jQuery.

HTH,
Dan

Marnen Laibow-Koser

unread,
Jan 6, 2011, 10:33:24 PM1/6/11
to rubyonra...@googlegroups.com
Ants Pants wrote in post #972949:

> Aren't the remote helpers built with prototype?
>
> Best thing I ever did was move away from Prototype.

Why?

Best,
-- 
Marnen Laibow-Koser
http://www.marnen.org
mar...@marnen.org

Sent from my iPhone

Ants Pants

unread,
Jan 7, 2011, 4:40:51 AM1/7/11
to rubyonra...@googlegroups.com
Why?! Well, Prototype was great to get up and started and do fancy things, but then when I wanted to know how things worked or have more control, I found I didn't know how to. Having a method that you pass arguments to is great but it isn't enough.

JQuery is a steeper learning curve but you have more control, your javascript is in js files and not sprinkled around your HTML and you actually learn more about the front end.

I'm a backend developer and hate the front end but it has been kind of fun (but stressful and frustrating) and I have learned heaps.

That's why. but I guess it horses for courses.

--

Frederick Cheung

unread,
Jan 7, 2011, 5:15:08 AM1/7/11
to rubyonra...@googlegroups.com, rubyonra...@googlegroups.com


On 7 Jan 2011, at 09:40, Ants Pants <antsmai...@gmail.com> wrote:

Why?! Well, Prototype was great to get up and started and do fancy things, but then when I wanted to know how things worked or have more control, I found I didn't know how to. Having a method that you pass arguments to is great but it isn't enough.


Sounds like you're more against rjs and link to remote than prototype. I'd say what you say below is pretty true of prototype too. 

Fred

Marnen Laibow-Koser

unread,
Jan 7, 2011, 11:31:14 AM1/7/11
to rubyonra...@googlegroups.com
Please quote when replying.

Ants Pants wrote in post #973055:


> Why?! Well, Prototype was great to get up and started and do fancy
> things,
> but then when I wanted to know how things worked or have more control, I
> found I didn't know how to.

RTFM?

> Having a method that you pass arguments to
> is
> great but it isn't enough.

Huh? I'm not sure what you mean by this.

>
> JQuery is a steeper learning curve but you have more control, your
> javascript is in js files and not sprinkled around your HTML

You can do that with any JS framework, or with none. And you should --
JS doesn't ever belong in HTML.

I'm not a Prototype supporter as such, but your reasons for not using it
seem pretty specious.

> and you
> actually learn more about the front end.

So, I'll ask again: what properties *of the jQuery framework* make it
superior to Prototype in your opinion.

>
> I'm a backend developer and hate the front end but it has been kind of
> fun
> (but stressful and frustrating) and I have learned heaps.
>
> That's why. but I guess it horses for courses.

Best,

Ants Pants

unread,
Jan 7, 2011, 1:09:11 PM1/7/11
to rubyonra...@googlegroups.com
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonra...@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-ta...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.


Calm down, mate!! Jesus, have you lost your toys from your pram or something?

As far I'm aware, I never said JQuery was superior. I am aware of saying it's horses for courses. I'm also aware that my comments were opinion and not fact, based on my experience with Prototype. They apply to me, is that okay? You may also read back and see I'm a back end developer who can't stand the front end. Again, from my experience with Prototype and JQuery (plugins and api) I much prefer JQuery. I'm sorry I have an opinion and it doesn't meet with your exacting standards.

That's the only answer you're getting because it's aggressive hoity toity people like you that get my back up.

Now, go out and either retrieve your toys or buy some new ones.

Colin Law

unread,
Jan 7, 2011, 3:45:18 PM1/7/11
to rubyonra...@googlegroups.com
On 7 January 2011 18:09, Ants Pants <antsmai...@gmail.com> wrote:
> [...]

> As far I'm aware, I never said JQuery was superior. I am aware of saying
> it's horses for courses. I'm also aware that my comments were opinion and
> not fact, based on my experience with Prototype.

I am afraid that if you make statements such as
> JQuery ..., your javascript is in js files and not sprinkled around your HTML ...
which appears to be a statement of fact rather than opinion, then
someone will ask you to justify the assertion.

It is necessary to challenge such statements so that others finding
the thread will understand the issues.

Colin

Marnen Laibow-Koser

unread,
Jan 8, 2011, 12:21:28 AM1/8/11
to rubyonra...@googlegroups.com
Ants Pants wrote in post #973159:

> On 7 January 2011 17:31, Marnen Laibow-Koser <li...@ruby-forum.com>
> wrote:
>
>> > Having a method that you pass arguments to
>> JS doesn't ever belong in HTML.
>> >
>> mar...@marnen.org

>> To unsubscribe from this group, send email to
>>
>
rubyonrails-ta...@googlegroups.com<rubyonrails-talk%2Bunsu...@googlegroups.com>

>> .
>> For more options, visit this group at
>> http://groups.google.com/group/rubyonrails-talk?hl=en.
>>
>>
> Calm down, mate!! Jesus, have you lost your toys from your pram or
> something?

Insults are not necessary. And I was quite calm when I wrote that.


>
> As far I'm aware, I never said JQuery was superior. I am aware of saying
> it's horses for courses. I'm also aware that my comments were opinion
> and
> not fact, based on my experience with Prototype.

And I wanted to understand why you prefer jQuery to Prototype. I still
do want to understand that, in fact; I'm kind of on the fence about the
two frameworks.


> They apply to me, is
> that
> okay? You may also read back and see I'm a back end developer who can't
> stand the front end. Again, from my experience with Prototype and JQuery
> (plugins and api) I much prefer JQuery. I'm sorry I have an opinion and
> it
> doesn't meet with your exacting standards.

Uh, what? I am *asking* your opinion. I *want to hear* your opinion.


>
> That's the only answer you're getting because it's aggressive hoity
> toity
> people like you that get my back up.

I thought you might be interested in explaining why you prefer jQuery.
Apparently it is now somehow unreasonable to ask for the rationale
behind your decisions...?

>
> Now, go out and either retrieve your toys or buy some new ones.

I have plenty of cool toys, thankyouverymuch.

Reply all
Reply to author
Forward
0 new messages