Rails 3.0.11, Ruby 1.9.3
When I use a javascript_include_tag(“js/datepicker”) in my view file
it includes 2 files.
<script src="/js/datepicker.js?1336410184" type="text/javascript"></script>
<script src="/javascripts/widgets/tooltip.js?1332959153" type="text/javascript"></script>
Note the second one I didn’t specified, still its getting included.
I have following folders and files:
/public/javascripts
/public/javascripts/widgets
/public/javascripts/widgets/tooltip.js
/public/js
/public/js/datepicker.js
My application uses Prototype and jQuery.The datepicker.js is actually the Protoplasm Datepicker control.
/config/application.rb
config.action_view.javascript_expansions[:defaults] = %w(jquery jquery_ujs jquery.prettyPhoto)
Can anybody please make me understand what is the cause behind /javascripts/widgets/tooltip.js getting automatically included?
Thanks,
Jignesh
Ok I found the answer.
Following is the plugin included in my application:
rails-widgets-jquery (http://github.com/paolodona/rails-widgets/wikis)
A file named core.rb of this plugin at rails-widgets-jquery/lib/widgets/core.rb
redefines the javascript_include_tag which is causing the behavior mentioned in my question.
Source Code below:
Thanks @Salil for your responses.Those helped me getting to above answer.
Thanks,
Jignesh