How to apply a patch to core rails using git?


#1

There is a patch for using the :selected option with collection_select
here -
http://rails.lighthouseapp.com/projects/8994/tickets/1037-selected-option-is-ignored-for-collection_select.

Can someone tell me how to apply it? I have git 1.6.0.1 on leopard.


#2

On 2 Jan 2009, at 04:47, Ram wrote:

There is a patch for using the :selected option with collection_select
here - http://rails.lighthouseapp.com/projects/8994/tickets/1037-selected-option-is-ignored-for-collection_select
.

Can someone tell me how to apply it? I have git 1.6.0.1 on leopard.

Checkout rails from github and switch the relevant branch
Download the patch file
cd to where you have checked rails
git am path/to/file

Fred


#3

i have rails already in my mac… i cant find the folder though. it
came with the OS X Leopard.

On Jan 2, 3:11 pm, Frederick C. removed_email_address@domain.invalid


#4

On 3 Jan 2009, at 10:06, Ram wrote:

i have rails already in my mac… i cant find the folder though. it
came with the OS X Leopard.

You’ll need to get it from git. There’s also no guarantee that it will
apply on anything but edge.

Fred


#5

On Jan 5, 4:21 am, Ram removed_email_address@domain.invalid wrote:

oh ok… so what about the version in my mac? will that get overridden?
will my existing apps know which Rails to use? I will have to change
the version number in the environment config file if im using edge
right?

First off, you may not want to use edge. You can get basically any
version of rails from git. It might be sensible to stick to the 2.2
stable branch if you were previously on 2.2 (or 2.1 stable if you were
on 2.1 etc…). If you’ve never upgraded rails you may have a slightly
rocky road as the version that came with leopard was 1.2 which is a
fair few version numbers behind.

The way I tend to do things is to freeze rails into the app: the app
has its private copy of rails in vendor/rails which you can patch/
modify as much as you want without affecting other apps. If you git
clone rails into vendor rails your app will start using that version,
no matter what environment.rb says

You could also just edit the rails that came with your machine (gem
which foo tells you where the gem called foo is installed if my memory
is correct) but that doesn’t sound very nice. I’d certainly recommend
freezing rails into your app before you do anything (whether it’s
freezing the version you’re currently using or edge rails).

Fred


#6

oh ok… so what about the version in my mac? will that get overridden?
will my existing apps know which Rails to use? I will have to change
the version number in the environment config file if im using edge
right?

On Jan 3, 4:06 pm, Frederick C. removed_email_address@domain.invalid