Hi all, Just been working on a new app and I''ve hit a problem. I am trying to render some js back to the page and have tried the following: render_js render :js => true render :js => "alert(''test'');" And I always seem to get my js returned as text. I have also added in: provides :js I''m sure this is very simple but any pointers would be most welcome! Thanks Thomas
On Jan 7, 2008, at 11:28 AM, Thomas Pomfret wrote:> render :js => "alert(''test'');" > > And I always seem to get my js returned as text.Merb doesn''t have an RJS mechanism. You''ll need to handle processing the JS yourself. I assume someone will eventually make a merb_rjs or merb_prototype plugin to add these helpers.
On Jan 7, 2008, at 1:06 PM, Se?or J. Onion wrote:> I used render :js => "alert(''Hi'');", :layout => :none > > With provide :js declared at the top of my class .... It''s working > for me. > > (Michael - it''s not RJS...)Joerg, what does your view look like? And yeah, I didn''t mean RJS, I meant the "wrap it in eval" thing render :js does.