Sign in through GitHub

RailsCasts Pro episodes are now free!

Learn more or hide this

wingleungchoi's Profile

GitHub User: wingleungchoi

Comments by

Avatar

Hey guys.

DEPRECATION WARNING: link_to_function is deprecated and will be removed from Rails 4.1.

Hope the following codes could help anyone. ;)

First. Pass args by data-["someAttributes] in a link

ruby
- link_to_function(name, "add_fields(this, \"#{association}\", \"#{escape_javascript(fields)}\")")
+ link_to(name, "#", "data-association" => "#{association}" , "data-content" => "#{fields}", :class => "link_to_add_fields" )

Then. Add an eventListener to the above link rather than to use link_to_function

ruby
+$(document).on("click", "a.link_to_add_fields", function(e){
+        e.preventDefault();
+        var link = $(this);
+        var association = $(this).data("association");
+        var content = $(this).data("content");
+        add_fields(link, association, content);
+});
Avatar

The XML Spreadsheet does not work. :(
My OS X 10.02 and Numbers version: 3.5
what i can see in Numbers are the following
<?xml version="1.0"?>

Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet"

xmlns:o="urn:schemas-microsoft-com:office:office"

xmlns:x="urn:schemas-microsoft-com:office:excel"

xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"

xmlns:html="">http://www.w3.org/TR/REC-html40">

Worksheet ss:Name="Sheet1">

Table>

Row>

ID

Name

Release Date

Price

/Row>
........

Avatar

Do mercury.js have to be in assets/javascripts?
remove //= require_tree . in application.js is the only way to prevent load it on all pages?