This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
If running rails ... commands on OSX you get: | |
SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed | |
Then: | |
1. Install cert | |
sudo port install curl-ca-bundle | |
2. When running rails command, do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Tested: PhoneGap 1.2, XCode 4.2 | |
If you are trying to connect to an external server from your | |
appYou must add the host (e.g. github.com) to your | |
PhoneGap.plist file. | |
In XCode: | |
1) Find PhoneGap.plist: should be in dir <your_app>/Supporting Files | |
2) Find or create the ExternalHosts prop | |
3) The ExternalHosts prop should be an array. Add an item an input your |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Tested on: Rails 3.1.3, jquery-rails (1.0.18), jquery-ui-1.8.16 | |
Ref: http://jqueryui.com/demos/autocomplete/ | |
Steps: | |
1. Create form with text field to be autocompleted | |
2. Hook up autocomplete | |
3. Write an autocomplete function in your Rails controller to return data | |
4. Create a rails route |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Tested on: pg (0.11.0) OS X Snow Leopaard | |
export PATH=/opt/local/lib/postgresql84/bin:${PATH} | |
env ARCHFLAGS="-arch x86_64" gem install pg | |
where postgresql84 is install dir |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Tested on: Rails 3.1.x, Heroku Cedar stack | |
1. Generate/develop local Rails app, add mongoid gem, bundle install etc. | |
2. Git the App | |
3. Generate Heroku Cedar App: | |
heroku create --stack cedar | |
4. Rename app | |
heroku rename <newname> | |
5. Install heroku mongoHQ or mongolab: | |
heroku addons:add mongohq:free |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Ref http://devcenter.heroku.com/articles/custom-domains | |
Heroku Setup | |
1. Install Custom Domain Plugin for your app | |
heroku addons:add custom_domains | |
2. Add domain names | |
heroku domains:add www.example.com | |
GoDaddy Setup | |
1. Go to your domain under your account |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(courtesy OpenGotham) | |
Setting up a local git clone of project | |
git clone [email protected]:<project>.git | |
Branching Workflow | |
All work is done in topic branches. Generally a topic branch maps directly to a feature requests. | |
Before a developer begins to work on code they should : | |
git co -b wip_short_desc_of_intended_wk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Tested on: Rails 3.1 | |
If have error: | |
ActionDispatch::Session::SessionRestoreError (Session contains objects whose class definition isn't available. | |
Remember to require the classes for all objects kept in the session. | |
can fix by changing a char in secret token in initializers/secret_token.rb | |
MyApp::Application.config.secret_token |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Tested on: Rails 3.1, Mongoid 2.0.1, pg 0.12.0 gem | |
Migrate from Mongo to PG | |
1. remove mongoid gem | |
2. add pg gem | |
3. in application.rb re-add ActiveRecord | |
4. for all models | |
- inherit from ActiveRecord::Base | |
- get rid of Mongoid:Document line | |
- make migrations and put fields there |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Tested on: Rails 3.1 | |
In this example, you want to return as json a group of Items and the name of the Company which makes them. | |
Models are as follows: | |
class Company < ActiveRecord::Base | |
has_many :items | |
class Item < ActiveRecord::Base |
OlderNewer