I have a Rails 3.1 project with the asset pipeline working great. The problem is that I need to reference images in my Sass, but Rails calculates image URLs. (This is particularly important in production, where Rails appends the Git hash of the image to its filename to bust caches.) For example, in app/assets/stylesheets/todos.css.scss: .button.checkable { background-image: url(/assets/tick.png);
Using Ruby on Rails 3's new routing system, is it possible to change the default :id parameter resources :users, :key => :username come out with the following routes /users/new /users/:username /users/:username/edit ...etc I'm asking because although the above example is simple, it would be really helpful to do in a current project I'm working on. Is it possible to change this parameter, and if no
Recently, I've read quite a few articles about Minitest. I really like the idea of a super lightweight test framework. I decided to replace rspec with it in a recent project and have had no luck getting it all to work. My problems are a) getting named routes in my acceptance/integration tests (rspec and test::unit seem to automatically include them but no go with minitest), b) and the overall lack
I want to make a copy of an ActiveRecord object, changing a single field in the process (in addition to the id). What is the simplest way to accomplish this? I realize I could create a new record, and then iterate over each of the fields copying the data field-by-field - but I figured there must be an easier way to do this. Perhaps something like this: new_record = Record.copy(:id)
I want to make emacs indent ruby method calls like: foo( :blah => 'bar', :shibby => 'baz' ) The closest I can get is: foo( :blah => 'bar', :shibby => 'baz' ) This is using ruby-deep-indent-paren, ruby-deep-indent-paren-style, ruby-deep-arglist all set to nil. Hashes indent how I like... if I could just make method calls indent like hashes I would be happy. Any ideas?
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く