asset-pipeline

Rails 3.2.3 JavaScript suddenly stopped working

别来无恙 提交于 2019-12-25 00:26:00
问题 I'm not sure how or why this happened, but if anyone could suggest a course of action, I'd really appreciate it. Is there anything I can type into the console to figure out why it's not working? I've tried 'bundle update' a few times and restarted my server, but nothing's working. 回答1: So, I found out what was wrong: I had a coffeescript error in one of my XXXXXXX.js.coffee files. I found out this was the problem by reloading the page with chrome's javascript console open. It logged an error

Rails 3.1, can't make link_to image_path?

核能气质少年 提交于 2019-12-24 19:15:13
问题 I want to make a fairly straightforward image link that uses an image from my assets. Getting weird errors. First I tried: <%= link_to assets_path "town.png", 'index' %> and got the error Started GET "/" for 127.0.0.1 at Wed Nov 30 17:27:10 -0500 2011 Processing by PagesController#intro as HTML Rendered pages/intro.html.erb within layouts/application (114.9ms) Completed 500 Internal Server Error in 124ms ActionView::Template::Error (undefined method `assets_path' for #<#<Class:0x10fdc4898>

Ruby on Rails: Ran rake assets:precompile and now both local and heroku deployment don't include bootstrap

狂风中的少年 提交于 2019-12-24 19:08:37
问题 I was having issues deploying my project to a heroku server (Precompile fail). So I found this response, https://stackoverflow.com/a/13713753/2989437, and followed up on the advice. I added one line to my application.rb file: application.rb module FirstEdc class Application < Rails::Application config.assets.initialize_on_precompile = false # I added this line ... end end I then ran the precompile command, committed the changes, and managed to deploy successfully to heroku. However, now my

Custom Font not working in Rails Asset Pipeline

别来无恙 提交于 2019-12-24 17:43:29
问题 I have this file structure in my Rails app: \APP +---assets | +---fonts | | icons.eot | | icons.svg | | icons.ttf | | icons.woff | +---icons | +---images | +---javascripts | +---stylesheets +---controllers | ... etc ... The custom font I have (icons) works in development, but not in production (or staging). I know it has something to do with the asset pipeline (404 errors). How do I get my icons / font to show up? My _icons.scss file (included in application.css.scss ): @font-face { font

Custom Font not working in Rails Asset Pipeline

北城以北 提交于 2019-12-24 17:42:02
问题 I have this file structure in my Rails app: \APP +---assets | +---fonts | | icons.eot | | icons.svg | | icons.ttf | | icons.woff | +---icons | +---images | +---javascripts | +---stylesheets +---controllers | ... etc ... The custom font I have (icons) works in development, but not in production (or staging). I know it has something to do with the asset pipeline (404 errors). How do I get my icons / font to show up? My _icons.scss file (included in application.css.scss ): @font-face { font

Javascript asset pipeline: 404 error - How to include Google analytics code in Rails?

ぃ、小莉子 提交于 2019-12-24 16:47:59
问题 I'm trying to include Google Analytics in my Rails app but am having problems with Rails its asset pipeline. I created a new file ( app/assets/javascripts/google-analytics.js ) in which I included the Javascript code supplied by Google. To application.html.erb I added the line: javascript_include_tag 'google-analytics' if Rails.env.production? . Unfortunately it doesn't work in production. After pushing to Heroku, the source code includes: <script src="/javascripts/google-analytics.js"><

Asset pipeline - application.js not compiled/loaded

为君一笑 提交于 2019-12-24 16:16:11
问题 I'm using rails 4 with foundation 5 and I'm having trouble getting javascript to work. Foundation's navbar menu doesn't drop down in mobile and I'm having trouble getting the jQuery datepicker to work. After a bit of searching on this site and on Google, I thought the problem might be that I was using sprockets version 2.1.2. However, after upgrading (now at version 3.3.4) the problem still hasn't been solved. I removed everthing in application.js and added a function to simple append one div

font glyphicons not working with bootstrap 3 and rails 4

假装没事ソ 提交于 2019-12-24 14:46:36
问题 I cannot get glyphicons to work with bootstrap 3 and rails. I've scowered the internet and nothing i find helps. In my bootstrap.css file i have: @font-face { font-family: 'Glyphicons Halflings'; src: url('/assets/glyphicons-halflings-regular.eot'); src: url('/assets/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'), url('../fonts/glyphicons-halflings-regular.woff') format('woff'), url('../fonts/glyphicons-halflings-regular.ttf') format('truetype'), url('../fonts

chosen-rails error chosen is not a function

心不动则不痛 提交于 2019-12-24 14:35:01
问题 I am using chosen-rails for integration of chosen.js with rails asset pipeline I have included in my Gemfile gem 'chosen-rails' then bundle install in my application.js I have //= require jquery //= require jquery_ujs //= require chosen-jquery //= require_self in my application.css I have *= require chosen The page loads the js as required /assets/jquery.js?body=1 /assets/jquery_ujs.js?body=1 /assets/lib/select-parser.js?body=1 /assets/chosen.jquery.js?body=1 But I I try to use the function

Background images in rails production don't work

房东的猫 提交于 2019-12-24 10:54:05
问题 Background images in rails 4(production env) don't work. It seems to me that there is a problem with asset pipeline. When I write in css: selector{ background-image: url(image.jpg) } it generates http://myapp.com/assets/image.jpg and it doesn't work. If I change url manually to image.jpg-fingerprint(from public/assets) then everything is okay. ckeditor also doesn't work. Here is my production.rb config.cache_classes = true config.assets.enabled = true config.eager_load = true config.assets