[Rails] Re: how to pass ruby objects to javascript ?

2009-07-23 Thread vlain
Wrap variables around <%= %> inside double quote e.g. for(var j=0; j < "<%=locations.length%>"; j++) On Jul 22, 4:17 pm, Nilesh Kulkarni wrote: > hi all, > >    I have following problem, > >    I am using google map api , I have  "business_locations" array > defined in view it contains latitud

[Rails] Code refactoring is the key

2008-12-30 Thread vlain
After six month of development and a first release we decide to refactor our application. Since it was my first Ruby/Rails application there are a lot of horrible things inside it. And now? Some general hints? I start with 2 simple questions: 1 - Where I put some common methods? Inside applicati

[Rails] Re: Update Ajax RJS problem link_to_function

2008-11-26 Thread vlain
Sorry, I found the solution. Simply I was looking in the wrong place (a little break was useful). Update in the Ajax is the error, change with Ajax.Request in the the method reloadPane solves the problem: new Ajax.Request(src, {asynchronous:1, evalScripts:true, onLoading:function(req

[Rails] Update Ajax RJS problem link_to_function

2008-11-26 Thread vlain
Hello to all. I use ajax tabs (rails redux) http://actsasflinn.com/Ajax_Tabs/index.html. I have 2 simple tab ("All" and "Favorites"). As default "All" is selected, when I click "Favorites" request is correct and there is the render of rjs but I obtain the classic error: ... try { Element.update("