asset-pipeline

Serving images from public folder when using asset pipeline Rails 3.2

≡放荡痞女 提交于 2019-12-21 20:43:33
问题 I am using Rails 3.2 asset pipeline to serve my assets(images, javascript. css). I have added paperclip for photo uploads. paperclip by default stores files in public/system When I use the url generated by paperclip which is something like /system/users/avatar/000/000/thumb/whatever.jpg It gives me no route error. the file is there at the above location but I think it may be issue with asset pipleline. Any ideas what might be going wrong ? 回答1: just like user451893 said. you should configure

Rails asset pipeline can't find one certain image

强颜欢笑 提交于 2019-12-21 18:31:26
问题 I have a certain image called ui-icons_ffffff_256x240.png . In production it can be found, among other places, in public/assets/images/ui-icons_ffffff_256x240.png . When I try to view this image in production, I get the following error: ActionController::RoutingError (No route matches [GET] "/assets/images/ui-icons_ffffff_256x240.png"): I find this extremely odd since the image most certainly is there: $ find . -name ui-icons_ffffff_256x240.png ./vendor/assets/stylesheets/jquery-ui/images/ui

Rails asset pipeline and javascript files - maintaining line breaks to aid debugging

冷暖自知 提交于 2019-12-21 17:31:55
问题 I recently migrated from Jammit to the Rails Asset Pipeline. Other than a few teething issues, everything has been working well. However, I recently started getting some script errors in production, and realised that it's near on impossible for me to debug them. I had previously configured Jammit to retain linebreaks, but otherwise remove all white space in the javascript files. This was to ensure that should I see a runtime error, I would be able to locate the offending line and hopefully

Why does rails precompile task do non-digest assets

爱⌒轻易说出口 提交于 2019-12-21 17:28:54
问题 When I do: rake assets:precompile RAILS_ENV=production I get for example the following files in my public/assets folder: application-7af6c31514bcdd4cce3c96892af4487f.js application-7af6c31514bcdd4cce3c96892af4487f.js.gz application.js application.js.gz The last 2 are a problem because it causes the compiled version to get served in development and I don't understand why they are being generated. I have the following line in my production.rb: config.assets.digest = true 回答1: To stop the

Rails assets missing after Capistrano deploy

杀马特。学长 韩版系。学妹 提交于 2019-12-21 14:33:30
问题 I'm building a VPS, and it's deployed via Capistrano, database connected etc, but there are no assets available to the page - it is basic html only. The assets appear to be compiled, and exist in the shared directory. From the page html: <link href="/assets/application-a1b5d69aeaff709fd3dce163c559b38b.css" media="all" rel="stylesheet" type="text/css" /> <script src="/assets/application-0ebd07089629f8c6880dddfb688d525d.js" type="text/javascript"></script> The asset files appear to exist in the

Rails assets missing after Capistrano deploy

徘徊边缘 提交于 2019-12-21 14:32:53
问题 I'm building a VPS, and it's deployed via Capistrano, database connected etc, but there are no assets available to the page - it is basic html only. The assets appear to be compiled, and exist in the shared directory. From the page html: <link href="/assets/application-a1b5d69aeaff709fd3dce163c559b38b.css" media="all" rel="stylesheet" type="text/css" /> <script src="/assets/application-0ebd07089629f8c6880dddfb688d525d.js" type="text/javascript"></script> The asset files appear to exist in the

Integrate Grunt into Rails asset pipeline [closed]

空扰寡人 提交于 2019-12-21 12:31:32
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 4 years ago . I would like to exchange / enhance the asset Pipeline with some Grunt tasks. Is there a Way i can integrate grunt into my build process? 回答1: You might want to check out the gem half-pipe And here is a video explaining it 来源: https://stackoverflow.com/questions/20025091/integrate

application.css not being served as an asset

ぃ、小莉子 提交于 2019-12-21 09:11:31
问题 EDIT 4, 5 and 6 8 hours in, any more ideas are welcome :) Maybe this bug is already known and solved, but I get the behaviour I described in edit 2&3, when you have this in a .css.erb file in app/assets/stylesheets : li { background-image: url(<%= asset_path "logo_80px_80px.png" %>); } The problem part seems to be the asset_path method call, but .css.scss also breaks it with: li { background-image: url(image-path("logo_80px_80px.png")); } My GemFile is: source 'http://rubygems.org' gem 'rails

config.assets.precompile not adding vendor/gem assets

感情迁移 提交于 2019-12-21 07:15:50
问题 I'm having trouble getting vendorized assets to be compiled as root files. I want to have the following assets available standalone (not packaged with other assets_: vendor/gems/neo-viz/app/assets/stylesheets/neo-viz.css.scss vendor/gems/neo-viz/app/assets/javascripts/neo-viz.js.coffee vendor/gems/neo-viz/app/assets/javascripts/lib/jQuery/jquery-1.6.1.min.js vendor/gems/neo-viz/app/assets/javascripts/lib/arbor/arbor.js With the following line: config.assets.precompile += %w( jquery-1.6.1.min

Acquire Asset Path from JavaScript

喜欢而已 提交于 2019-12-21 06:56:09
问题 I need to display images on an HTML5 canvas that are in the Rails asset pipeline, but I need to know the path for the asset from JavaScript. I'm using js-routes for other parts of the application, but it doesn't appear to provide a way to get the path to something in the asset pipeline. What's the correct way to obtain the path to a Rails asset (e.g., an image) from JavaScript? 回答1: In the Rails Asset Pipeline guide, they give an example of coding assets in your stylesheets by preprocessing