Thursday, January 12, 2006

RollingOnRails: Possible to use RJS to send dynamic JavaScript to client?

I am try'g to figure out some easy way in rails for flushg user specific(generated diff for each client, actually jst some variable value changes)Javascript to browser

Following is what I have tried
1) Client requests javascript by
script src="http://perfecthost/model/getjs/213j5sxfsaj23523"
On server side I need to change 3 variable values bfore I flush JS to client, now since rhtml dnt understand JS content type, I am left with newly introduced RJS

2) Since RJS templates is not yet in Rails 1.0 i have installed this plugin from Fausr site simply using following
script\plugin install http://www.codyfauser.com/svn/projects/plu
gins/javascript_generator_templates/

3) Now I copied all the JS code in getjs.rjs,

4)Now I get error say'g template not found.
Seems like I have tell controller tht I am using RJS template?and few other things?

Any1 can point to the sample? Sample given here really don't help !
Just to make things lil more tougher plugins page has gone under maintenance, I hope it will come-up by morning...

Tags:

No comments: