Forum: Ruby on Rails Application Helper and Javascript

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Dylan S. (Guest)
on 2006-01-25 20:04
(Received via mailing list)
I have a "javascript_include_tag" including a Javascript function.
I have a function being invoked via a helper in the same view, which
prints
out a script tag that uses the javascript function above.

Problem is, the function being invoked via the helper can't find the
javascript function included in the "javascript_include_tag".

I hardcoded the javascript that exists in the "javascript_include_tag",
into
the head of the view... and the helper had no problem finding the
method.
So... it seems that the helper is being invoked before the
"javascript_include_tag" declaration ?

Does this seem correct ?
Jonathan V. (Guest)
on 2006-01-25 21:30
Why not just include the javascript file in the <head> tag? Can you post
the code you are using?

-Jonny.

Dylan S. wrote:
> I have a "javascript_include_tag" including a Javascript function.
> I have a function being invoked via a helper in the same view, which
> prints
> out a script tag that uses the javascript function above.
>
> Problem is, the function being invoked via the helper can't find the
> javascript function included in the "javascript_include_tag".
>
> I hardcoded the javascript that exists in the "javascript_include_tag",
> into
> the head of the view... and the helper had no problem finding the
> method.
> So... it seems that the helper is being invoked before the
> "javascript_include_tag" declaration ?
>
> Does this seem correct ?
Dylan S. (Guest)
on 2006-01-25 23:08
(Received via mailing list)
Jonathan... SVN problem, and my Javascript wasn't updated.  It all works
now.
One sec.... going to go bury my head in the sand real quick :)
Jonathan V. (Guest)
on 2006-01-25 23:35
It happens to all of us ;)

-Jonny.

Dylan S. wrote:
> Jonathan... SVN problem, and my Javascript wasn't updated.  It all works
> now.
> One sec.... going to go bury my head in the sand real quick :)
This topic is locked and can not be replied to.