sprockets

Rails 3.1 with Asset Pipeline, link_to :confirm message showing twice?

江枫思渺然 提交于 2019-12-03 10:23:38
Okay, so I've seen this question about this problem being caused by multiple linkings of jQuery or Prototype, but I can confirm that I'm only linking to jQuery once on the entire page. My problem is this: when I have a link_to that confirms a deletion, the popup shows twice. Here's the applicable code in my template (written in Slim): link_to('Destroy', depot_path(@depot.id), :confirm => "Really?", :method => :delete) I'm running Rails 3.1.0 with the Asset Pipeline turned on, with gem 'jquery-rails' in my Gemfile , and the following is in my application.js file (which is compiled by Sprockets

rails generate rspec:install - no such file to load --sprockets/railtie (LoadError)

这一生的挚爱 提交于 2019-12-03 07:21:34
I'm a RoR-Beginner and I started learning it with the RoR-Tutorial. Actually I'm at this chapter ( http://ruby.railstutorial.org/chapters/static-pages#top ) and try to install rspec. But everytime when I try to use "rails g rspec:install" I get this error message: C:\Sites\rails\rails_projects\sample_appp>rails g rspec:install C:/Sites/rails/rails_projects/sample_appp/config/application.rb:8:in `require': no such file to load -- sprockets/railtie (LoadError) from C:/Sites/rails/rails_projects/sample_appp/config/application.rb:8:i n `<top (required)>' from C:/RailsInstaller/Ruby1.9.2/lib/ruby

How to disable adding “.self.” in Sprockets 3.0

点点圈 提交于 2019-12-03 06:30:31
问题 Even if config.assets.digest = false is set Sprockets 3.0 keep adding .self. to all static files: application.css becomes application.self.css?body=1 How to disable adding self ? It is needed for correct browsersync work. 回答1: In Sprockets 3, .self.css is added because you have the config.assets.debug = true config set (not the digest config, that's unrelated). If you add the following to your development.rb or production.rb file, it will work as you expect: config.assets.debug = false 回答2:

require_tree argument must be a directory in a Rails 5 upgraded app

拈花ヽ惹草 提交于 2019-12-03 04:31:33
I just upgraded my app from Rails 4.2.7 to Rails 5.0.0.1 . I used RailsDiff to make sure I had everything covered and I believe I did. So far everything has worked well up until the loading of my app. Now I am seeing this error: Sprockets::ArgumentError at / require_tree argument must be a directory This is my application.css : /* * This is a manifest file that'll be compiled into application.css, which will include all the files * listed below. * * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets, * or any plugin's vendor/assets/stylesheets

Using RequireJS with a Rails 3.1 app

谁说胖子不能爱 提交于 2019-12-03 03:11:19
问题 Question If you've used RequireJS with a Rails 3 (esp 3.1) app, how is that working for you? Any configuration tricks or other gotchas that I need to watch out for? Background I'm contemplating using RequireJS over the Sprockets-based Asset Pipeline in Rails 3.1, specifically for JavaScript code. I have two motivators for this choice: I want to leverage RequireJS' module management for my JS client-side code. I'd like a precompilation system that can follow my JS library code into other

“require_tree argument must be a directory” rails 3.1.1 precompile assets

血红的双手。 提交于 2019-12-03 02:20:18
问题 I've been round and round here with trying to get the assets to pre-compile on my production server (straightforward ubuntu install with ruby 1.9.2 and Rails 3.1.1, and tried 3.1.2RC with the new sprockets 2.10 as well). "require_tree argument must be a directory". I've seen other issues related to this on stack but the situation isn't exactly the same and none of the proposed solutions have helped – like create a stub file in the sub folder, then reference only relatively at that point. No

Rails 3.1: The public directory no longer serves js assets. How to load an additional js file after page is loaded?

余生长醉 提交于 2019-12-03 00:48:13
I use a jQuery plugin that loads another js file from the server after the initial page load. Since all js assets are concatenated in Rails 3.1 and the public directory is not used to serve js assets, how can I reference this file? Where do I put it? Every asset in the Sprockets load path is accessible at runtime. You can see your load path in Rails console with Rails.application.config.assets.paths You can add load paths in an initializer: Rails.application.config.assets.paths << your_load_path By default, all assets in apps/assets/ and vendor/assets/ are loaded automatically. These assets

How to disable adding “.self.” in Sprockets 3.0

瘦欲@ 提交于 2019-12-02 20:06:33
Even if config.assets.digest = false is set Sprockets 3.0 keep adding .self. to all static files: application.css becomes application.self.css?body=1 How to disable adding self ? It is needed for correct browsersync work. In Sprockets 3, .self.css is added because you have the config.assets.debug = true config set (not the digest config, that's unrelated). If you add the following to your development.rb or production.rb file, it will work as you expect: config.assets.debug = false Downgrading sprockets worked for me. Add the following to your Gemfile gem 'sprockets', '2.11.0' and run bundle

Rails 4 static assets in public/ or app/assets/

守給你的承諾、 提交于 2019-12-02 18:14:23
Sorry if this is a lengthy buildup to a simple question, but I wanted to get my thoughts clear. I've used Rails 4 on a couple projects now and I've been using image_tag('/assets/image.png') to get around the changes to how asset path helpers work in Rails 4. That is until today when I decided to learn more about the changes and found this first change note in sprockets-rails . I've also noted that the ASSET_PUBLIC_DIRECTORIES in /actionview/lib/action_view/helpers/asset_url_helper.rb#L170 in Rails helpers only point to public folders. It became pretty obvious to me that if you are accessing

Source maps in Ruby on Rails through sprockets

☆樱花仙子☆ 提交于 2019-12-02 17:30:39
I'd like to add source map support on a rails 3.2 application I am working on. As far as I know, generating source maps is not supported by Sprockets and from its github page it looks like the feature is planned for 4.0. I am working with Sprockets 2.2 and I think monkey patching is the only way to go. The module Processing under the main Sprockets module gives access to the js_compressor function which can be patched to generate source map for a single file. But, I don't know how to add this when the JS files combine. I am using Uglifier 2.4 as the compressor. The project has a mixture of