asset-pipeline

Simple Javascript Joyride plugin in rails

拥有回忆 提交于 2019-12-20 04:23:11
问题 I'm afraid my plugin isn't working properly because of a misunderstanding of rails. I'm adding zurbs joyride plugin to an index page. I have the following in vendor/assets/javascripts/joyride - joyride-2.0.3.js jquery.cookie.js modernizr.mq.js And referencing them the following way in application.js - //= require jquery //= require jquery-ui //= require jquery_ujs //= require joyride/joyride-2.0.3 //= require joyride/modernizr.mq.js //= require joyride/jquery.cookie //= require_tree . And the

Asset pipeline not precompiling sass

僤鯓⒐⒋嵵緔 提交于 2019-12-20 04:15:20
问题 I've updated my app to use the rails 3.1 asset pipeline (I think). I can compile .css files but not css.scss. I am running the sass-rails gem but nothing seems to work. What should I check? Sorry, I don't know exactly what info I should supply here to help debug. I can edit this... EDITS: My .scss file contains: /* *= require_self *= require_tree . */ edit: see Sprockets::CircularDependencyError in Store#index Thanks, Rim 回答1: Remember that css.scss files need to be included, not imported

Rails 3.1 Possible Bug in Asset Pipeline and Uglifier

谁说我不能喝 提交于 2019-12-19 22:16:23
问题 I ran into a problem deploying on Heroku do to a failure in the rake task rake assets:precompile At the bottom is the error I get if I integrate Rails 3.1 Jquery calendar: https://github.com/themouette/jquery-week-calendar Twitter bootstrap The error happens from uglifier. I suspect that problem could be related to the inclusion of many localizations for the calendar. I worked around the error by setting: # Compress JavaScripts and CSS config.assets.compress = false I was not able to examine

Is there a way to tell Google Closure Compiler to *NOT* inline my local functions?

左心房为你撑大大i 提交于 2019-12-19 11:49:22
问题 Here's what I'm looking for: I want to use the wonderful features of SIMPLE mode minification while disabling just one specific feature (disable local function inline). UPDATE: The answer is NO, it's not possible given my setup. But for me there is a workaround given I am using Grails. As @Chad has explained below, "This violates core assumptions of the compiler". See my UPDATE3 below for more info. IN QUESTION FORM: I'm using CompilationLevel.SIMPLE_OPTIMIZATIONS which does everything I want

Naming imported scss files .scss or .css.scss

◇◆丶佛笑我妖孽 提交于 2019-12-19 07:56:15
问题 I was trying to get livereload working with rails 3.2, and I came across this question, of which there is a reference to not naming imported sass partials with .css.scss: Rails: Use livereload with Asset Pipeline Is this correct that imported SCSS files should be named file.scss and not file.css.scss? 回答1: Honestly, I don't think it matters much. As a convention, I generally name files that will eventually be output as an actual CSS file as .css.scss and imported files as .scss. I do the same

Image showing as blank in Rails 3.1 on Production (Heroku)

六眼飞鱼酱① 提交于 2019-12-19 06:16:36
问题 I recently updated my Rails to 3.1. Here's a part where I added: <%= asset_path('logo_symbol.png') %> This renders /assets/logo_symbol.png which works perfectly fine in development environment. However, when i push the code to production on heroku, it shows a broken image, with the url: assets/logo_symbol-135ddc8db2c9b59f032bed7db520137a.png . I am guessing the new name is for the reason of some optimization. It is however interesting to note that when I go to the assets/logo_symbol

Rails 3.1 assets has no fingerprint in production

一世执手 提交于 2019-12-19 05:59:21
问题 Just started to adapted to rails 3.1, I started to write coffeescript and sass and everything works fine in development. When I run the server in production, I only get: <link href="/stylesheets/application.css" media="screen" rel="stylesheet" type="text/css" /> <script src="/javascripts/application.js" type="text/javascript"></script> in the source code of the page, there's no hashcode generated and both assets has routing errors: Routing Error No route matches [GET] "/stylesheets

JST undefined for rails 3.1 application

痞子三分冷 提交于 2019-12-19 05:23:43
问题 Most rails 3.1 tutorials regarding the asset pipeline and javascript templating lead me to believe that the asset pipeline will pick up any *.jst files and slap them into a JST variable that's available to your *.js files. However, I'm currently stumped with the following error when I try to load a *.jst template: Uncaught ReferenceError: JST is not defined Any pointers? 回答1: if you are using a require line like //= require_tree ../templates make sure that line is above the line that includes

javascript can't find the image file (Rails 4 app)

谁说我不能喝 提交于 2019-12-19 04:48:15
问题 I have a ruby on rails 4 app. In app/assets/javascripts , I created a file map.js to draw some custom markers on google map: var marker = new google.maps.Marker({ draggable: false, title: 'Hi', icon: 'icon1.png' }); Everything is working fine, except it can't find icon.png and gives me the error message ActiveRecord::RecordNotFound (Couldn't find User with id=icon1) . The problem is most likely with how to write the file address, because if I change the code to icon: 'https://maps.google.com

Rails images and assets not being loaded properly

女生的网名这么多〃 提交于 2019-12-19 03:18:53
问题 For example, in my Rails application I have something like: .wax_seal { background: url("wax-seal-small.png"); display: block; height: 100px; margin: 0 auto; width: 92px; } .wax_seal:active { background: url('wax-seal-small-broken.png'); } And in my config/environments/production.rb file: # Disable Rails's static asset server (Apache or nginx will already do this). config.serve_static_assets = true I manually invoke the compiling of assets: bundle exec rake assets:precompile And the files are