You have to call it from your view or it will never be executed an example controller: def index @objects = Object. Find(:all) respond_to do |format| format. Js{ render :text => "alert('hello')" } end end and an index.html.
Erb with: script type="text/javascript"> $(function(){ $. Ajax({ url: '/controller', type: 'get', dataType:'script' }); }); Rjs with: page. Alert("hello world") or: page.
You have to call it from your view or it will never be executed. An example controller: def index @objects = Object. Find(:all) respond_to do |format| format.
Js{ render :text => "alert('hello')" } end end and an index.html. Erb with: replace '/controller' with the actual url that executes that controller's index action, by default for PostsController it will be '/posts' and so on... if you like rjs you delete the {} and everithing in it in the controller and create an index.js. Erb or index.
Rjs with: page. Alert("hello world") or: page.
I my situation, I don't have an html version of this action, its strictly for loading pages via ajax (endless pagination). For some reason, even when I call render :text => "alert('hello');" in my respond_to block, I still don't get alerted, but firebug says I'm getting a text/javascript response with the correct content. – asoules Jan 6 '10 at 21:49 3 Well.
Turns out I forgot dataType : 'script' in my ajax call. Thanks for your help, wouldn't have caught that one on my own. – asoules Jan 6 '10 at 21:52.
I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.