5
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

自分用railsスケルトン作った

Last updated at Posted at 2015-09-15

更新しました→http://qiita.com/craftpaperbag/items/ecc396fcd6c46d4dbb15


skelton.png

特徴は以下

  • rspecとcapybara
  • unicorn
  • bootstrap
  • slim
  • CircleCIでビルドするためのcircle.ymlのひながた
  • herokuで使うためのpostgres指定
  • spec は Feature と Model だけ(ほかは自動生成しない)
  • 揮発性メッセージのラクチン指定(後述)

使い方

ファイルをコピー
ここはもっと賢いやり方があるはず

git clone https://github.com/craftpaperbag/skelton.git
rm -rf skelton/.git
cp -r skelton/ target/ && cd target/

エディタで編集

config/database.yml に Heroku PostgreSQL の情報記載
config/secrets.yml に rake secret で作ったものを投入
config/application.rb のモジュール名をアプリ名に変更
config/initializers/session_store.rb のキーをアプリ名に変更
app/views/layout/application.html.slim の34行目を自身のコピーに変更

起動

bundle exec rspec
bundle exec rails s

とりあえずここまでで http://localhost:3000 うごきます。
Circle CI、Heroku 割愛

おまけ機能:揮発性メッセージのラクチン指定

views/shared/ に
表示したいメッセージのテンプレートを作る。
_hogehoge.html.slim など。

controller処理内でよぶ

message 'shared/hogehoge'

flashに保存されてる。
viewで表示するときは

= render 'shared/messages'

ちょっと適当すぎるので改善したい点

ruby 2.1.3 ...なぜ
Gemfile汚い
message機能を動的な感じに。
使い始めにエディタ使うのいけてないので別の方法使う
この記事を綺麗にする
ほかいろいろ

5
5
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?