I am using paperclip with uploadify and I was able to get it working fine. I am also using some AJAX so that a couple of submit buttons do not trigger a reload of the whole page. It was working fine before and it has stopped working now (the log shows that no js.erb is called).
This is what I have in my app:
[remi@iMac]$ l public/javascripts/
total 728
-rw-r--r--@ 1 remi staff 148 May 17 08:01 application.js
-rw-r--r--@ 1 remi staff 34787 May 17 08:01 controls.js
-rw-r--r--@ 1 remi staff 31056 May 17 08:01 dragdrop.js
-rw-r--r--@ 1 remi staff 38467 May 17 08:01 effects.js
-rw-r--r--@ 1 remi staff 72328 May 22 10:50 jquery-1.4.2.js
-rw-r--r--@ 1 remi staff 162353 May 17 08:01 prototype.js
-rw-r--r--@ 1 remi staff 5850 May 17 08:01 rails.js
-rwxr-xr-x@ 1 remi staff 10220 May 17 08:01 swfobject.js
drwxr-xr-x 5 remi staff 170 May 22 10:38 uploadify
And I noticed that the order of the javascript include tags makes a difference. When I include jquery first, uploadify does not work but ajax works fine.
<%= javascript_include_tag "jquery-1.4.2.js" %>
<%= javascript_include_tag :defaults %>
When I change it, then uploadify works but clicking on my ajax buttons reloads the page:
<%= javascript_include_tag :defaults %>
<%= javascript_include_tag "jquery-1.4.2.js" %>
I am still new to this, can you point me to an explanation of some sort?
I guess jQuery and Prototype are fighting for the
$.You should setup
jquery-railsin your app so that Rails will rely on the framework you’re using elsewhere.See reference here.