asset-pipeline

Rails asset pipeline not including required files in application.js manifest

人走茶凉 提交于 2019-12-12 07:30:53
问题 The rails asset pipeline isn't including files required in application.js. The only javascript file rendered to the browser is application.js, and the require lines are not compiled to include tags as they should be: // This is a manifest file that'll be compiled into application.js, which will include all the files // listed below. // // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts, // or vendor/assets/javascripts of plugins, if any, can

Ruby on Rails asset pipeline doesn't work properly

元气小坏坏 提交于 2019-12-12 06:15:27
问题 I have been working on a ruby on rails project just now. I have created a controller named 'animals' and a view (index.html.erb) for index action. I don't want to include 'application' javascript file. So I created animals.js The file's content is //= require jquery //= require jquery_ujs //= require turbolinks //= require bootstrap-sprockets //= animals.coffee I have also added animals.js and animals.css to asset.rb Rails.application.config.assets.precompile += %w( animals.js ) Rails

Rails Asset Pipeline/Compass/SASS extremely slow to compile in development mode

大兔子大兔子 提交于 2019-12-12 05:52:04
问题 Using Rails 3.2, I have approximately 40 SASS files loading in my app. A large chunk of it is bootstrap. Each reload of any page takes 10+ seconds. If I remove <%= stylesheet_link_tag "application", :media => "all" %> pages load almost instantly. What's the best way to debug which stylesheets are causing the slowness? Or is it just the fact that I have 40+ partial .css.scss files which are all compiled on page refresh? I have an @import "mixins" at the top of almost every .scss file, which

Grails 3 - get asset path in service

别说谁变了你拦得住时间么 提交于 2019-12-12 03:27:00
问题 I need to get the path of a static resource located in assets/schemas/resource.json in a Grails 3 service. At the moment it is defined as private final String SCHEMA = 'grails-app/assets/schemas/resource.json', which is fine for development environment, but of course not for production (as it would be located in <app_root>/assets/resource.json . I tried to search how to exploit the Asset Pipeline in my case, but up to now I really have no idea :P Thanks in advance! 回答1: It is covered in the

Rails3.1.3 Error : /gems/actionpack-3.1.3/lib/action_dispatch/middleware/templates/rescues/routing_error.erb within rescues/layout

自古美人都是妖i 提交于 2019-12-12 03:18:00
问题 I am trying to use gem 'fancybox-rails' & have updated the files as required by gem. I created a controller and a view to generate a page with video links. I am using Rails 3.1.3. I have updated my bundle using "bundle update" & everything seems to be in line but I am getting the following error. Here is the whole code for the application : https://github.com/jaipratik/i_have_removed_it I am getting the following errors. Output - Development log (may be useful ) Rendered /Users/jayparteek/

Cannot configure assets via pipeline on local production rails 3.1.3 server

谁说我不能喝 提交于 2019-12-12 03:06:14
问题 This month, I upgraded from Rails 3.0 to Rails 3.1 - this week I tried to launch the server in production mode - today I have hit a wall ! I am unable to get my production environment server to serve up my public assets (JavaScript and CSS) via the asset pipeline, unless I set config.assets.compile = true in my environment.rb file, which for speed reasons I obviously don't want to do. I have a large number of JS and CSS files, each of which tends to get used on one or two different pages.

DRY MVC declarative minimal controller-specific asset pipeline

﹥>﹥吖頭↗ 提交于 2019-12-12 02:47:36
问题 There are several ways to include controller-specific assets in Rails: One option which is not DRY is to add = yield :head in the layout and content_for(:head) { ... } in every top-level view. If an asset is controller-specific, it should be specified only once per controller, not in each view. Of course, this approach is awesome for view -specific assets. A second option which is not declarative is to add an asset corresponding to the controller name if it exists. Instead of checking whether

Rails Assets in Production

人走茶凉 提交于 2019-12-12 02:35:07
问题 I've just migrated to rails 3.1 and I'm having trouble getting started with the asset pipeline. I ran: bundle exec rake assets:precompile RAILS_ENV=production after adding additional css files into config.assets.precompile += ['scaffold.css', 'other.css', 'other.js'] all of my files are located in the /app/asset images, javascripts, or stylesheets path. Following the rake task, I can see the manifest.yml file but it is missing the additional css and js files I added to the config.assets

Rails scss stylesheet per action

大兔子大兔子 提交于 2019-12-12 02:23:31
问题 How can I render a stylesheet per action in rails? Since my app is not the standart CRUD app, my controllers end up with a few custom routes which require very different CSS's. So, I'm wondering, is there any way to load the css on a per action basis but still take advantage of the asset pipeline? Thanks 回答1: create a directory for each of your controllers inside stylesheets directory and create css files corresponding to your action, then put this in you layout file <%= stylesheet_link_tag "

Editing my SASS stylesheets in the asset pipeline seems to break the asset pipeline

风格不统一 提交于 2019-12-12 02:03:51
问题 This is driving me nuts - I have a Rails app built on Bootstrap. I have been plugging along for a few weeks and today I hit a very bizarre issue. If I make any trivial change (i.e. add a new line and save) to ANY style sheet I loose a bunch of my CSS formatting. This is hard to explain without some how publishing all my code etc. The biggest symptom is the loss of my Google fonts. Here is the top part of my application.css.scss file: @import "font-awesome-sprockets"; @import "font-awesome";