Ruby
次のような中間テーブルを挟むhas_manyなDB構造の場合 users table id email 1 test1@gmail.com 2 test2@gmail.com 3 test3@gmail.com 4 test4@gmail.com 5 test5@gmail.com users_services table id user_id service_id role 1 3 2 role1 2 2 1 role2 3 3 3…
1. graphvizのインストール brew install cairo pango graphviz # Homebrew on Mac OS X sudo port install graphviz # Macports on Mac OS X sudo aptitude install graphviz # Debian and Ubuntu2. gemのインストール Gemfileにrails-erdを追加 group :dev…
createだとデータベースに保存される @user = FactoryGirl.create(:user) User id: 2, email: "MyString", password: "MyString", created_at: "2012-05-04 06:57:38", updated_at: "2012-05-04 06:57:38" buildだとデータベースに保存されないので、idやcre…
時間を重視で、名前が適当、デザイン適当、scaffold、 なのでドヤ顔できるレベルではありませんが。 https://github.com/YuuShigetani/rspec_practice
redirect_to ({:action => 'login'}), :notice => 'plz login'
and return をつける render :index and return
Gemfileに以下を追記 gem 'twitter-bootstrap-rails'以下のコマンドを実行 $ bundle $ rails g bootstrap:install
rails destroy scaffold "name"
Ubuntuの方も変わらないと思うので参考にどうぞrubyのバージョンはrbenvで管理しているものを対象に書いていきます。 普通にpassengerとかを入れて実行すると、 can not load -- bundlerとエラーが出て詰んでました。。。 rbenvのインストール apt-getでいけ…