Run rails new --help
to see all of the options you can use to create a new Rails application:
Output for Rails 8+
Usage:
rails COMMAND [options]
You must specify a command:
Run rails new --help
to see all of the options you can use to create a new Rails application:
Output for Rails 8+
Usage:
rails COMMAND [options]
You must specify a command:
# Original from http://snippets.dzone.com/posts/show/4468 by MichaelBoutros | |
# | |
# Optimized version which uses to_yaml for content creation and checks | |
# that models are ActiveRecord::Base models before trying to fetch | |
# them from database. | |
namespace :db do | |
namespace :fixtures do | |
desc 'Dumps all models into fixtures.' | |
task :dump => :environment do | |
models = Dir.glob(Rails.root + 'app/models/**.rb').map do |s| |
require 'aws-sdk' | |
class BucketSyncService | |
attr_reader :from_bucket, :to_bucket, :logger | |
attr_accessor :debug | |
DEFAULT_ACL = "public-read" | |
def initialize(from_bucket, to_bucket) |
Options included below:
docker-compose
brew
This gist was originally created for Homebrew before the rise of Docker, yet it may be best to avoid installing mysql via brew
any longer. Instead consider adding a barebones docker-compose.yml
for each project and run docker-compose up
to start each project's mysql service.
capybara needs qt5 to work with react. OSX probably has qt 4 installed by default.
thoughtbot/capybara-webkit#666
brew uninstall qt
brew install qt5
brew linkapps qt5
brew doctor
gem uninstall capybara-webkit
def search_chosen(selector, search) | |
page.execute_script "jQuery('#{selector}').click();" | |
find('div.chzn-search input').set search | |
end | |
def select_from_chosen(selector, name) | |
page.execute_script "jQuery('#{selector}').click();" | |
page.execute_script "jQuery(\".chzn-results .active-result:contains('#{name}')\").click();" | |
wait_for_ajax | |
end |
create different ssh key according the article Mac Set-Up Git
$ ssh-keygen -t rsa -C "[email protected]"
#Model | |
@user.should have(1).error_on(:username) # Checks whether there is an error in username | |
@user.errors[:username].should include("can't be blank") # check for the error message | |
#Rendering | |
response.should render_template(:index) | |
#Redirecting | |
response.should redirect_to(movies_path) |
def select_from_chosen(item_text, options) | |
field = find_field(options[:from]) | |
option_value = page.evaluate_script("$(\"##{field[:id]} option:contains('#{item_text}')\").val()") | |
page.execute_script("$('##{field[:id]}').val('#{option_value}')") | |
end |
## Prepare ################################################################### | |
# Remove RVM | |
rvm implode | |
# Ensure your homebrew is working properly and up to date | |
brew doctor | |
brew update | |
## Install ################################################################### |