asset-pipeline

font-awesome-rails icon formatting incorrect on heroku

烈酒焚心 提交于 2019-12-13 08:08:20
问题 I'm using font-awesome-rails to generate some icons on my site. When I run the site locally, the image icons appear correctly (they are styled to be different colors). However, when I push to production via Heroku, the styling is messed up (some icons don't appear, and none of the icons are the right color). What could I be doing wrong? I'm not even sure what could be wrong with my code, so if any particular snippets would be helpful for me to share, let me know and I'll add it. The image on

Ruby 1.9 throwing javascript encoding error

邮差的信 提交于 2019-12-13 07:16:26
问题 So, I updated my Ruby to 1.9.2, followed this: Make sure 'config.encoding = "utf-8"' is there in application.rb file. Make sure you are using 'mysql2' gem Putting '# encoding: utf-8' on top of rake file. Above 'Starter::Application.initialize!' line in environment.rb file, add following two lines: Encoding.default_external = Encoding::UTF_8 Encoding.default_internal = Encoding::UTF_8 and now all my Ruby code is working right, but my assets/javascript/application.js is loaded only with this

Rails assets precompile mysterious error

一世执手 提交于 2019-12-13 05:23:51
问题 I have a really nasty and persistent problem in assets precompile which I seem not to be able to solve by myself. The compilation always fails in some file that does not have an error. For example the error below is in the file copies.js.coffee that has only a comment. If I delete that file, another file will have the error. The type of all my asset files is us-ascii - no strange characters in any file. I am using Rails 3.1.3. I have tried both with Ruby 1.9.2 and 1.9.3 - no difference. $

Heroku ignores public/assets/manifest-*.json

ε祈祈猫儿з 提交于 2019-12-13 04:50:06
问题 After running RAILS_ENV=production bundle exec rake assets:precompile and pushing to heroku, I get this error: Running: rake assets:precompile rake aborted! could not connect to server: Connection refused Is the server running on host "127.0.0.1" and accepting TCP/IP connections on port 5432? The complete log is here: http://dpaste.com/hold/1503531/ How can this happen when I have a public/assets/manifest-*.json file checked in? I'm using Rails 4.0.2. In my production.rb I have: config.assets

Rails Asset Pipeline JS Compression Inserting “Illegal Characters”

别等时光非礼了梦想. 提交于 2019-12-13 04:45:29
问题 I just asked a question about an "Illegal Character" in my javascript. The answer there led me to find that there is a problem with compressing javascript in the Rails asset pipeline inserting various Illegal Characters. The error I was receiving in the post was: SyntaxError: Invalid character '\u0008' I found that not using compression caused this to go away completely ... but I want compression! That error was found using the Rails default uglifer gem. I thought maybe it was a bug with that

How do I do Automating Ember testing with Dalek (setup/teardown of specific Ember components)

自作多情 提交于 2019-12-13 04:34:34
问题 My TLDR; version of my question is "Is there a way I can integrate with qunit such that Dalek can get the correct context when it needs it, or conversely, can I get Dalek to run setup/teardown asset-pipeline-compiled Ember javascript to build a context for it to run tests on?" Firstup Dalek look awesome ! All my tests are currently written in qunit. I'm having some problems automating tests around a component I'm building in Ember. The component is a kind of WYSIWYG textarea. (BTW, my qunit

rails assets pipeline with yielded javascript

余生颓废 提交于 2019-12-13 04:17:32
问题 since I wan't to keep my js files separated for some views, I am making use of a helper function inside the view which yields the js file into the html head def javascript(*files) content_for(:head) { javascript_include_tag(*files) } end So I was wondering how can I achieve this with assets the pipeline and the pre compile mechanism? Best, Phil 回答1: Every JS file that is being required in the HTML head section needs to be precompiled. By default only application.js is being precompiled, but

New Rails 3.2.8 app not loading jQuery

馋奶兔 提交于 2019-12-13 02:46:43
问题 I did a rails new today, then created a simple search bar: <form> <input id='search-bar' type='search' name='search'></input> </form> <a id='search-btn' href="#">searching!</a> Alright, how about some click handlers! So assets/javascripts/searches.js.coffee: $('#search-btn').click -> alert 'BOOM' query = $('#search-bar').html console.log query And... nothing. So I go to the Chrome console: >$('a') null >$('body') null >$ function () { [native code] } a jQuery with no selectors, not too

Access stylesheet_link_tag from controller

泄露秘密 提交于 2019-12-13 02:28:30
问题 Is there a was to call stylesheet_link_tag from the controller? I am creating a PDF file in memory and passing it along to an api call to another service. I am using PDFKit and it requires me to send the style sheet link to it. I am using Rails 3.1 and therefore need access to the asset pipeline through this method. Thanks for the help! 回答1: You should be able to use this to access the stylesheet from your controller: ActionController::Base.helpers.asset_path("stylesheet_i_want.css") 回答2:

Rails 3.1 asset pipeline with suburis

元气小坏坏 提交于 2019-12-13 02:12:07
问题 I'm trying to convert a Rails 3.1 app to use the asset pipeline. Currently using Rails 3.2.0.rc2. I'm setting ENV['RAILS_RELATIVE_URL_ROOT'] to the suburi in application.rb. The helpers work fine, generating the correct path (including the suburi) to the file, however Rails routes aren't serving the files off of that path. For instance, <%= stylesheet_link_tag 'screen', :media => 'screen' %> correctly generates the code <link href="/my-suburi/assets/screen.css" media="screen" rel="stylesheet"