How do I add jquery-ui to a Ruby on Rails 3.1 app?

后端 未结 8 1184
滥情空心
滥情空心 2020-12-17 10:31

I have added //=require jquery-ui to my application.js file and that seems to give me the javascript but I can\'t seem to get the stylesheets to be included. If

8条回答
  •  星月不相逢
    2020-12-17 11:01

    jquery-rails no longer has jquery-ui as part of its assets. You should use gem 'jquery-ui-rails' for that.

    Furthermore, to find out where an asset is coming form in rails you can do the following:

    paths = Rails.application.config.assets.paths
    for path in paths do
      puts "Found in: #{path}" if Dir.glob("#{path}/*").grep(/jquery-ui/).present?
    end
    

    This should make it easy to find the asset.

提交回复
热议问题