- ROR Lab.
- 운영진 : 김대권/최효성
- Michael Hartl의
Ruby on Rails Tutorial
을 한국어로 공동번역한다.
.vagrant/* | |
# development 환경 | |
.rbenv-vars | |
# staging 환경 | |
.rbenv-vars.staging | |
config/database.staging.yml | |
config/secrets.staging.yml |
#!/bin/sh | |
repo_name=$1 | |
test -z $repo_name && echo "Repo name required." 1>&2 && exit 1 | |
curl -u '[username]:[password]' https://api.github.com/user/repos -d "{\"name\":\"$repo_name\"}" | |
git init | |
git add . | |
git commit -m "initial commit" | |
git remote add origin "https://github.com/[username]/$repo_name.git" | |
git push -u origin master |
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
Vagrant.configure(2) do |config| | |
config.vm.box = "bento/ubuntu-16.04" | |
config.vm.network "forwarded_port", guest: 3000, host: 9000, auto_correct: true | |
config.vm.network "forwarded_port", guest: 80, host: 8080, auto_correct: true | |
# config.vm.network "private_network", ip: "192.168.33.10" | |
config.vm.provider "virtualbox" do | vb | | |
# vb.name = "RORLAB DEV Vagrant" |
echo "Provision virtual machine..." | |
echo "Updating Packages" | |
sudo apt-get update > /dev/null 2>&1 | |
echo "Installing Korean Language Pack" | |
sudo apt-get install language-pack-ko -y > /dev/null 2>&1 | |
echo "Set TimeZone to Asia/Seoul" | |
sudo timedatectl set-timezone Asia/Seoul |
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Blog</title> | |
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %> | |
<%= javascript_include_tag 'application', 'data-turbolinks-track' => true %> | |
<%= csrf_meta_tags %> | |
</head> | |
<body> |
module ApplicationHelper | |
def flash_class(level) | |
case level | |
when :notice then "info" | |
when :success then "success" | |
when :error then "danger" | |
when :alert then "warning" | |
# else "info" | |
end |
<%%= simple_form_for(@<%= singular_table_name %>) do |f| %> | |
<%%= f.error_notification %> | |
<%- attributes.each do |attribute| -%> | |
<div class="form-group"> | |
<%%= f.<%= attribute.reference? ? :association : :input %> :<%= attribute.name %>, input_html: { class: 'form-control' } %> | |
</div> | |
<%- end -%> | |
<div class="form-actions"> |