RPSという、プロポーザル投稿システムの改修に関連して、Ruby on Railsを使ってプロトタイピングをしてみたときの作業ログ。自分用です。

install
sudo gem update --system
sudo gem i rails --pre
sudo gem i webrick
sudo gem i sqlite3

rails new opss --database sqlite3

cd opss
rm public/index.html
rails generate controller home index

nano config/routes.rb
---------------------------------------------
  root :to => 'home#index'
---------------------------------------------

nano app/views/home/index.html.erb
---------------------------------------------
<h1>ASTRO-H Observation Proposal Submission System</h1>
<h2>Prototyped using Ruby on Rails</h2>
<%= link_to "List proposal and Send new proposals", proposals_path %>
---------------------------------------------

rake db:create

rails generate scaffold proposal name:string title:string abstract:text content:text targetName:string targetRA:string targetDec:string

nano app/models/proposal.rb
---------------------------------------------
class Proposal < ActiveRecord::Base
  attr_accessible :abstract, :content, :name, :targetDec, :targetName, :targetRA, :title

validates :abstract,  :presence => true
validates :content,  :presence => true
validates :name,  :presence => true
validates :targetDec,  :presence => true
validates :targetName,  :presence => true
validates :targetRA,  :presence => true
validates :title,  :presence => true
end
---------------------------------------------

rake db:migrate

nano app/assets/stylesheets/proposals.css.scss 
---------------------------------------------
td {
 border: 1px solid;
}

th {
 border: 2px solid;
}
---------------------------------------------
rails server