Javascript without rjs

I’ve been googling for ages, please help.

I don’t want to use rjs and the view helpers for prototype, I just
want to render javascript (jquery), and no I don’t want to use jrails
either as this just partially mimics those same helpers.

Can’t I just render a some_action.js file?

Rails 2.0.2

Can’t I just render a some_action.js file?

Not entirely sure if that’s what you mean (it’s way past my bedtime :),
but I use a JavascriptsController. This way, a request to
‘/javascripts/some_action.js’ will be either satisfied by serving a
static file from public/javascripts, or if no such file exists, by a
controller method of that name from my JavaScriptsController, which
renders a nice dynamic show_action.js.erb view.

Hope this helps,

I don’t suppose you could give me an example. Promise I’ll write it up
for the group.


On Apr 23, 12:58 am, Jan F. [email protected]

Yes, I want to create raw (at least not using helpers) dynamically, so
I could use e.g. jquery.

On Apr 23, 11:24 am, Jan F. [email protected]

I’m well rested now, but I am still not sure what you’re trying to
achieve. You are not bound to use any helpers at all; you are free to
write JS directly into your views the usual way if that is what you

If you want to include an external script into a view, just put it into
the public/javascripts folder of your application and include it either
manually or through the javascript_include_tag helper.

The JavascriptsController only makes sense if you have the need to
create JS dynamically, say, with ERb.

I’d be happy to provide examples, I just need to know which direction
you’re heading here.


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