asset-pipeline

Rails I18n of CSS file

最后都变了- 提交于 2019-12-18 03:41:40
问题 I am trying to internationalize my site, and one thing is to use different font-size for different languages. Also some text-images need to be replaced as well. I think the only way to do this is to have additional locale-specific CSS files in the public folder and load them based on locale in my view. This avoids asset pipeline from compiling those specific CSS files. But I am wonderiing if there a better way to do this? 回答1: Your best bet in organization is to have different style sheets

rails assets pipeline “Cannot allocate memory - nodejs”

耗尽温柔 提交于 2019-12-17 23:26:42
问题 we've just upgraded to Rails 3.2.5 from Rails 3.0.7 and using the assets-pipeline compilation on the fly for the staging server, but some times we face this exception ! Showing /var/rails/appname/app/views/common/_my_partial.html.haml where line # raised: Cannot allocate memory - nodejs /tmp/execjs20120613-17090-thoc8f.js 2>&1 Extracted source (around line #): Trace of template inclusion: app/views/layouts/application.html.haml Although nothing fancy or huge memory allocations is done in the

Images and assets not working in my production server on rails 3.1.0

我是研究僧i 提交于 2019-12-17 23:08:56
问题 I switched my server to production and i cannot get any of my images to load. It all works fine on development mode but when i switched to production it all stopped working i have enabled server_static_assets and still yet nothing works. Any help towards doing this 回答1: Here are a few problems that you might be having: 1 - Your production configuration may not be correct. This is particularly likely if you started out with an early 3.1 release candidate, and have been updating along the way.

sass-rails helpers “image-url”, “asset-url” are not working in rails 3.2.1

▼魔方 西西 提交于 2019-12-17 21:49:03
问题 I am on 3.2.1, with sass-rails-3.2.4 and sass-3.1.15... The documentation for the asset pipeline says: asset-url("rails.png", image) becomes url(/assets/rails.png) image-url("rails.png") becomes url(/assets/rails.png) ... So I made the following file: # app/assets/stylesheets/public/omg.css.sass body background: asset-url('snake.gif', image) #lol background: image-url('snake.gif') and when I visit localhost:3000/assets/public/omg.css I get: body { background: asset-url("snake.gif", image); }

What exactly “config.assets.debug” setting does?

孤者浪人 提交于 2019-12-17 18:49:05
问题 I have started development of simple rails application. After several hours work I have notices that somehow the deleted css is still applied to the web pages. In order to fix the issue I executed the following actions several times: stop/start server use rails server use torquebox server delete browser cache but nothing changes. It was very strange - the new css definitions were applied, but those that I have deleted were still there. So, I gave up and decided to create new project. I have

Rails Active Admin css conflicting with Twitter Bootstrap css

☆樱花仙子☆ 提交于 2019-12-17 10:19:18
问题 I'm somewhat new to the Rails asset pipeline so I might be doing something wrong. I'm trying to use Active Admin for my backend and twitter bootstrap css for my front end application. I added the bootstrap.css to /app/assets/stylesheets then also added: //= require bootstrap to application.css - then I did a precompile of the assets locally It seems to work fine but some of the styling isn't coming through exactly and I think it's because active admin's css is overriding it. My understanding

Rails 3.1 Assets - Strange Serving in Development

时光毁灭记忆、已成空白 提交于 2019-12-17 10:18:48
问题 I've got a problem with Rails 3.1 assets pipeline. Assets are included twice in development: <script src="/assets/main_new.js?body=1" type="text/javascript"></script> <script src="/assets/pagenav.js?body=1" type="text/javascript"></script> <script src="/assets/tours.controller.js?body=1" type="text/javascript"></script> <script src="/assets/tours.js?body=1" type="text/javascript"></script> <script src="/assets/application.js?body=1" type="text/javascript"></script> Rails somehow compiles and

Default_url in Paperclip Broke with Asset Pipeline Upgrade

孤街醉人 提交于 2019-12-17 09:22:11
问题 I'm using Paperclip and have a default_url option like this for one of my attachments: :default_url => '/images/missing_:style.png' The asset pipeline obviously doesn't like this since the directories moved. What's the best way to handle this? I have two styles for this picture (:mini and :thumb). 回答1: :default_url => ActionController::Base.helpers.asset_path('missing_:style.png') Then put the default images in app/assets/images/ 回答2: Tested only on Rails 4. To make it work in production, we

Rails App Not Serving Assets in Production Environment

被刻印的时光 ゝ 提交于 2019-12-17 08:32:18
问题 My app works fine when run in development environment. In production ( rails server -e production ), the browser can't access the css and js files and on the console there are messages like: I, [2013-07-27T21:00:59.105459 #11449] INFO -- : Started GET "/javascripts/application.js" for 99.102.22.124 at 2013-07-27 21:00:59 +0000 F, [2013-07-27T21:00:59.108302 #11449] FATAL -- : ActionController::RoutingError (No route matches [GET] "/javascripts/application.js"): The head section from html

Proper SCSS Asset Structure in Rails

被刻印的时光 ゝ 提交于 2019-12-17 06:22:23
问题 So, I have an app/assets/stylesheets/ directory structure that looks something like this: |-dialogs |-mixins |---buttons |---gradients |---vendor_support |---widgets |-pages |-structure |-ui_elements In each directory, there are multiple sass partials (usually *.css.scss, but one or two *.css.scss.erb). I might be assuming a lot, but rails SHOULD automatically compile all the files in those directories because of *= require_tree . in application.css, right? I recently have tried restructuring