Repeated methods in rjs

Is there a way to use any kind of helper or something if you do the
same thing on every rjs call? Like render a flash box div?

Chris H. wrote:

Is there a way to use any kind of helper or something if you do the
same thing on every rjs call? Like render a flash box div?

Why not write JavaScript directly in unobtrusive style, and call the
appropriate function as necessary?

Best,
–Â
Marnen Laibow-Koser
http://www.marnen.org
[email protected]

It is a full ajax site. flash gets rendered on every call, nothing
in it if it is empty anyway.

Please quote when replying – otherwise we don’t know what you’re
responding to.

Chris H. wrote:

It is a full ajax site. flash gets rendered on every call, nothing
in it if it is empty anyway.

So what? That’s irrelevant to the advice I gave, isn’t it?

Best,
–Â
Marnen Laibow-Koser
http://www.marnen.org
[email protected]

Ok, how would I implement the manual JS version to get called
automatically on every rjs render?

For the second time: please quote when replying!

Chris H. wrote:

Ok, how would I implement the manual JS version to get called
automatically on every rjs render?

Why do you need RJS?

Best,
–Â
Marnen Laibow-Koser
http://www.marnen.org
[email protected]

Chris H. wrote:

" Why do you need RJS? "

It is an ajax call

That doesn’t require RJS.

Best,
–Â
Marnen Laibow-Koser
http://www.marnen.org
[email protected]

“That doesn’t require RJS.”

Ok, this is an early build out I do not want updates in the controller
ase
may have additional stuff in the future and i do not want the controller
cluttered up.

On Thu, Feb 11, 2010 at 12:27 PM, Marnen Laibow-Koser

" Why do you need RJS? "

It is an ajax call

Chris H. wrote:

“That doesn’t require RJS.”

Ok, this is an early build out I do not want updates in the controller
ase
may have additional stuff in the future and i do not want the controller
cluttered up.

On Thu, Feb 11, 2010 at 12:27 PM, Marnen Laibow-Koser

Who said anything about cluttering the controller? RJS serves no useful
purpose as far as I can see (I could be wrong).

Anyway, you’re being so vague about the structure of your app that it’s
not possible to help. Try providing more information.

Best,
–Â
Marnen Laibow-Koser
http://www.marnen.org
[email protected]

On Thu, Feb 11, 2010 at 12:27 PM, Marnen Laibow-Koser
[email protected] wrote:

Chris H. wrote:

" Why do you need RJS? "

It is an ajax call

That doesn’t require RJS.

Why the war on RJS? It’s been working great for me since Rails 0.8.


Greg D.
destiney.com | gregdonald.com

Greg D. wrote:

On Thu, Feb 11, 2010 at 12:27 PM, Marnen Laibow-Koser
[email protected] wrote:

Chris H. wrote:

" Why do you need RJS? "

It is an ajax call

That doesn’t require RJS.

Why the war on RJS?

What war? It doesn’t seem to be serving the OP well.

It’s been working great for me since Rails 0.8.

How do you keep the generated JavaScript out of your HTML?


Greg D.
destiney.com | gregdonald.com

Best,
–Â
Marnen Laibow-Koser
http://www.marnen.org
[email protected]

Greg D. wrote:

On Thu, Feb 11, 2010 at 12:39 PM, Marnen Laibow-Koser
[email protected] wrote:

Who said anything about cluttering the controller? �RJS serves no useful
purpose as far as I can see (I could be wrong).

Serves no useful purpose? The one I wrote a few minutes ago seems
damn useful to me and my app.

Let’s see it! I’m always willing to learn.

The 98349837498 RJS files I’ve written
previously also seem very useful.

You’ve lived for millennia and written an RJS file every second?
Fascinating!

I think what’s useless here is most of what you post.

Personal attacks do not belong on this list, or any other.


Greg D.
destiney.com | gregdonald.com

Best,
–Â
Marnen Laibow-Koser
http://www.marnen.org
[email protected]

On Thu, Feb 11, 2010 at 12:39 PM, Marnen Laibow-Koser
[email protected] wrote:

Who said anything about cluttering the controller? RJS serves no useful
purpose as far as I can see (I could be wrong).

Serves no useful purpose? The one I wrote a few minutes ago seems
damn useful to me and my app. The 98349837498 RJS files I’ve written
previously also seem very useful.

I think what’s useless here is most of what you post.


Greg D.
destiney.com | gregdonald.com

“Anyway, you’re being so vague about the structure of your app that it’s
not possible to help. Try providing more information.”

It is a full ajax app. Meaning, the only real page refreshes are when
logging in and out. We have a ton of ajax calls. I was just trying to
DRY
up the rjs files if we load the flash box on every call.

On Thu, Feb 11, 2010 at 12:39 PM, Marnen Laibow-Koser

Greg D. wrote:

On Thu, Feb 11, 2010 at 12:42 PM, Marnen Laibow-Koser
[email protected] wrote:

Why the war on RJS?

What war? �It doesn’t seem to be serving the OP well.

And since by your own admission you know little to nothing about RJS
templates, what makes you an authority to dismiss them as “useless”?

I don’t claim to be one. I’m no RJS expert, and I do plan to look at
RJS in more detail the next time I need significant amounts of
JavaScript in a project. But I am an expert JavaScript programmer,
and I really do not see the advantage of not writing my JavaScript
directly.

Why do you prefer RJS to writing JavaScript?

�It’s been working great for me since Rails 0.8.

How do you keep the generated JavaScript out of your HTML?

Partials.

Wouldn’t that still put the JavaScript into your HTML files?


Greg D.
destiney.com | gregdonald.com

Best,
–Â
Marnen Laibow-Koser
http://www.marnen.org
[email protected]

On Thu, Feb 11, 2010 at 12:42 PM, Marnen Laibow-Koser
[email protected] wrote:

Why the war on RJS?

What war? It doesn’t seem to be serving the OP well.

And since by your own admission you know little to nothing about RJS
templates, what makes you an authority to dismiss them as “useless”?

It’s been working great for me since Rails 0.8.

How do you keep the generated JavaScript out of your HTML?

Partials.


Greg D.
destiney.com | gregdonald.com

On Thu, Feb 11, 2010 at 12:47 PM, Marnen Laibow-Koser
[email protected] wrote:

Personal attacks do not belong on this list, or any other.

Well someone had to say something, I’m sick of reading the crap you
post.


Greg D.
destiney.com | gregdonald.com

Greg D. wrote:

On Thu, Feb 11, 2010 at 12:47 PM, Marnen Laibow-Koser
[email protected] wrote:

Personal attacks do not belong on this list, or any other.

Well someone had to say something, I’m sick of reading the crap you
post.

Then don’t read it and don’t make attacks like this. I’m sure everyone
has posters they feel this way about – I know I do – but we don’t say
that kind of thing.


Greg D.
destiney.com | gregdonald.com

Best,
–Â
Marnen Laibow-Koser
http://www.marnen.org
[email protected]

On Thu, Feb 11, 2010 at 1:15 PM, Marnen Laibow-Koser
[email protected] wrote:

Then don’t read it and don’t make attacks like this. I’m sure everyone
has posters they feel this way about – I know I do – but we don’t say
that kind of thing.

I saw what I feel like saying, especially to big mouth blow-hards like
yourself.


Greg D.
destiney.com | gregdonald.com

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs