[LRUG] Best practices for javascript in Rails apps

Frederick Cheung frederick.cheung at gmail.com
Thu Jul 18 06:17:51 PDT 2013


On 18 Jul 2013, at 14:14, Alexander Hockey-Sweeney <alexsween at gmail.com> wrote:

> On a related note to javascript within Rails apps - does anyone have any tips for reporting javascript errors (with a Rails app)? Something similar to the rails exception_notification gem, but for javascript.
> 

Both airbrake and honey badger do js error reporting as well as server side. I've not used either for that though.

Fred


> Google digging yielded a few solutions (below), but wondering if anyone has come across other solutions.
> 
> Cheers,
> Alex
> 
> 
> http://devblog.pipelinedeals.com/pipelinedeals-dev-blog/2012/2/12/javascript-error-reporting-for-fun-and-profit-1.html
> http://jslogger.com/
> 
> 
> 
> 
> 
> 
> 
> 
> On Thu, Jul 18, 2013 at 1:56 PM, David Salgado <david at digitalronin.com> wrote:
> 
> On 18 July 2013 13:10, Frederick Cheung <frederick.cheung at gmail.com> wrote:
> There's still a slightly awkward feeling when I want to pass a larger chunk of data to the javascript. I normally end up with a inline javascript snippet setting window.foo but I've never felt very happy about that.
> 
> I use gon for that;
> 
> https://github.com/gazay/gon
> 
> Also mentioned here;
> 
> http://railscasts.com/episodes/324-passing-data-to-javascript
> 
> It's doing the same thing under the hood, but it's a nice encapsulation.
> 
> David
> 
> 
> 
> 
> _______________________________________________
> Chat mailing list
> Chat at lists.lrug.org
> http://lists.lrug.org/listinfo.cgi/chat-lrug.org
> 
> 
> _______________________________________________
> Chat mailing list
> Chat at lists.lrug.org
> http://lists.lrug.org/listinfo.cgi/chat-lrug.org




More information about the Chat mailing list