株式会社オイアクスは Ruby on Rails 専門のウェブ開発 & IT コンサルティング会社 です。
Link: oiax.jp
$ cd ~/rails_root # 次のコマンドは、CentOS で PostgreSQL を使用する場合のみ実行(242ページ参照) $ bundle config build.pg --with-pg-config=/usr/pgsql-9.1/bin/pg_config $ bundle install --path vendor/bundle --without development test
module ApplicationHelper include HtmlBuilder def table_of_users(users) markup do |m| m.table(id: 'users') do m.tr do m.th 'Family Name' m.th 'Given Name' end users.each do |u| attrs = {} attrs[:class] = 'admin' if u.admin? m.tr(attrs) do m.td u.family_name m.td u.given_name end end en...
Starting Zeus server [ready] [crashed] [running] [connecting] [waiting] boot └── default_bundle ├── development_environment │ └── prerake └── test_environment └── test_helper Available Commands: [waiting] [crashed] [ready] zeus rake zeus runner (alias: r) zeus server (alias: s) zeus d...
class UserPresenter attr_accessor :user, :view_context delegate :family_name, :given_name, to: :user def initialize(user, view_context) self.user = user self.view_context = view_context yield(self) if block_given? end def full_name family_name + ' ' + given_name end def full_name_with...
% rake routes root / {:controller=>"welcome", :action=>"index"} new_user_session GET /users/sign_in {:controller=>"devise/sessions", :action=>"new"} user_session POST /users/sign_in {:controller=>"devise/sessions", :action=>"create"} destroy_user_session GET /users/sign_out {:controll...
MySQL 5.6 を使って Rails の開発環境構築を試みましたが、エラーが出てデータベースに接続できません。 OS は Windows 7 です。 エラーメッセージは、次の通り: rake aborted! cannot load such file -- mysql2/2.0/mysql2 私は普段 Ubuntu 上で開発しているためこの問題には遭遇していませんでした。Windows を開いてやってみると、確かに問題が再現されます。 答えは、例によって StackOverflow と GitHub で見つけました: http://stackoverflow...
require 'spec_helper' describe ReceptionDesk, '#sign_in' do context 'ユーザー名とパスワードが一致する場合' do let(:customer) { create(:customer, username: 'taro', password: 'correct_password') } specify '該当するCustomerオブジェクトを返す' do result = ReceptionDesk.new(customer.username, 'correct_password').sign_in...
require 'spec_helper' describe RewardManager, '#grant_login_points' do let(:customer) { create(:customer) } let(:date_boundary) { Time.zone.local(2013, 1, 1, 5, 0, 0) } before { Time.zone = 'Tokyo' } specify '土曜日の午前5時直前にログインすると、ユーザーの保有ポイントが1増える' do Timecop.freeze(Time.zone.local(2013,...