Javascript template, extension naming?

It seems that I have a choice of
blah.js
blah.rjs
blah.js.rjs
and blah.js.erb
plus I guess blah.rjs.erb (maybe)

I know that this is somewhat version dependent.
Which is the “bestest”? and is there a difference.

Thanks in advance.

Teedub wrote:

It seems that I have a choice of
blah.js
blah.rjs
blah.js.rjs
and blah.js.erb
plus I guess blah.rjs.erb (maybe)

I know that this is somewhat version dependent.
Which is the “bestest”? and is there a difference.

Remember, the template naming format is:
action.type.renderer

So for blah.html.erb, Rails will use the ERb renderer and serve the
result as HTML. Likewise, for blah.js.rjs , Rails will use the RJS
renderer and serve the result as JavaScript. blah.js would be a plain
JavaScript file that doesn’t get processed by Rails, and blah.rjs is the
deprecated Rails 1.x way of naming blah.js.rjs. The remaining
combinations are left as an exercise to the student. :slight_smile:

Thanks in advance.

Best,

Marnen Laibow-Koser
http://www.marnen.org
[email protected]

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