ruby-on-rails-3.1

Broken precompiled assets in Rails 3.1 when deploying to a sub-URI

主宰稳场 提交于 2019-11-28 21:58:21
I'm in the process of updating a Rails 3 app to use Rails 3.1 and as part of that, am making use of the new asset pipeline. So far, I've got everything working apart from one rather annoying problem I can't solve. The application and all its assets works fine in development, but in production it is deployed to a sub-URI using Passenger ( http://the-host/sub-uri/ ). The problem with this is that the assets are pre-compiled during deployment and one of my CSS (well, it's a .css.scss file) files is making use of the image-url helper from the sass-rails gem. Since during the pre-compilation

Integrating CKEditor with Rails 3.1 Asset Pipline

十年热恋 提交于 2019-11-28 21:29:11
I'm new to the Asset Pipeline, having just migrated over from Rails 3.0. I'm trying to get CKEditor into the pipeline, but all the gems for it are really unclear about how they work, and have little or no usage instructions. I would prefer to do this without using a gem, since it seems that all I have to do is drop the source files into the vendor/assets directory and then include them in application.js . I've tried that, however, when I precompile and push to production, it seems that some of the files aren't being found ( editor.css , for example), and the editor doesn't show up at all (just

Rails 3.1 issue with javascript_include_tag in application.html.erb

陌路散爱 提交于 2019-11-28 21:20:22
问题 I've created a clean and simple Rails 3.1 application called demo1. It contains two controllers - hello and goodbye. I get the following error when I try to load http://localhost:3000/say/hello: ActionView::Template::Error ( (in /home/me/dev/ruby/demo1/app/assets/javascripts/say.js.coffee)): 3: <head> 4: <title>Demo1</title> 5: <%= stylesheet_link_tag "application" %> 6: <%= javascript_include_tag "application" %> 7: <%= csrf_meta_tags %> 8: </head> 9: <body> app/views/layouts/application

How do I turn off automatic stylesheet/javascript generation on Rails 3.1?

不想你离开。 提交于 2019-11-28 20:52:24
问题 I've got a Rails 3.1 project that I'm working on, but I don't want controller_name.css.sass and controller_name.js.coffee to be generated each time I run rails generate controller controller_name . I could swear I've seen the setting somewhere on the internet, but I can't find it now for the life of me. What is it? Keep in mind that I'm still wanting to use the Asset Pipeline and the CoffeeScript/Sass integration, but I'm organizing those files in my own way. I'm pretty sure the answer is a

blueprint css rails 3.1 help

筅森魡賤 提交于 2019-11-28 20:24:45
My blueprint css works on my local machine, but when I push to heroku I get an error. I have blueprint stored in my app/assets/stylesheets folder and here are the stylesheet tags I'm using: <%= stylesheet_link_tag "application" %> <%= stylesheet_link_tag 'blueprint/screen', :media => 'screen' %> <%= stylesheet_link_tag 'blueprint/print', :media => 'print' %> In my heroku logs, it says application.css isnt precompiled and I think that might be the error, but I don't know how to fix it. Here is my heroku logs: 2011-09-04T07:35:59+00:00 heroku[web.1]: Idling 2011-09-04T07:36:00+00:00 heroku[web.1

Heroku logging not working

孤街浪徒 提交于 2019-11-28 19:39:57
I've got a rails 3.1 app deployed on Heroku Cedar. I'm having a problem with the logging. The default rails logs are working just fine, but when I do something like: logger.info "log this message" In my controller, Heroku doesn't log anything. When I deploy my app I see the heroku message "Injecting rails_log_stdout" so I think calling the logger should work just fine. Puts statements end up in my logs. I've also tried other log levels like logger.error. Nothing works. Has anyone else seen this? MBHNYC I was just having the same issue, solved by using the technique here: https://github.com

pdfkit does not style pdfs

帅比萌擦擦* 提交于 2019-11-28 19:28:42
I have a rails 3.1 app that creates pdf documents using pdfkit, and everything works as specified, except for the fact that the generated pdfs don't have any styling. I am assuming that wkhtmltopdf doesn't have access to my stylesheets and that it is not a larger issue than that. Would anyone have a clue as to how you would allow access to these stylesheets? I have basically followed railscast #220 on the subject, however I have had to create a new initializer to get pdfkit to work with rails 3.1. This is the initializer that I had to use to get pdfkit to work with rails 3.1 ActionController:

Test an HTTPS (SSL) request in RSpec Rails

ぃ、小莉子 提交于 2019-11-28 19:26:38
I'd like to take advantage of the force_ssl feature in rails 3.1rc4. class ApplicationController < ActionController::Base force_ssl end Problem is this breaks most/all of my existing RSpec controller specs. For example, this fails: describe "GET 'index'" do it "renders the Start page" do get :index response.should render_template 'index' end end Instead of rendering the page the response is a 301 redirect to https://test.host/ . How can I change my specs to simulate an HTTPS GET/POST? And do I have to change each test manually or is there an easier way? (I realise I could invoke force_ssl only

How to use compass with rails 3.1

陌路散爱 提交于 2019-11-28 18:37:24
问题 I have searched and searched and all I could see was that to use compass with rails 3.1 was to just edit the Gemfile like so: gem 'compass', :git => 'https://github.com/chriseppstein/compass.git', :branch => 'rails31' gem 'sass-rails', "~> 3.1.0.rc" Yes I understand that but what next? Every tutorial I saw said just that, use that certain fork. But I am still having trouble with using compass with rails 3.1. I did this: $ compass init rails . --syntax sass directory ./app/stylesheets/ create

What does require_self mean?

本秂侑毒 提交于 2019-11-28 17:43:26
In rails3.1 application.css we could see /* *= require_self *= require_tree . */ I know that require_tree . is just telling the system to bundle together everything from the stylesheets folder into a single file. But what does require_self tells? shedd From http://guides.rubyonrails.org/asset_pipeline.html : /* ... *= require_self *= require_tree . */ "In this example require_self is used. This will put the CSS contained within the file (if any) at the top of any other CSS in this file unless require_self is specified after another require directive. " Shedd's answer used to be correct but now