quattro_4's diary

また同じ過ちを繰り返すと気付かんのか!?

ブラウザだけで簡単なCMS(Refinery CMS)を作る (Action.io)

ブラウザだけでRailsアプリを試せるサービス (Action.io) - quattro_4's diary の続き

簡単なCMS(Rails)を作ることにした
CMSはRefinery CMSを初めて使う
Ruby on Rails CMS that supports Rails 3 - Refinery CMS

アカウントを取得してログインした状態から

  • 新規環境を作成(New Box)
  • Nameに適当な名前
  • Regionは Southeast Asia (Singapore) あたりを選択
  • Create Box

Consoleとエディタが出てくる

Consoleで

action@my-cms-1422:~$ ls
workspace
action@my-cms-1422:~$ pwd
/home/action
action@my-cms-1422:~$ cd workspace/
action@my-cms-1422:~/workspace$ gem install refinerycms
Fetching: acts_as_indexed-0.7.8.gem (100%)
...
Successfully installed actionmailer-3.2.12
37 gems installed

action@my-cms-1422:~/workspace$ refinerycms mycms
      create
      create  README.rdoc
...
        gsub    Gemfile
         run    bundle install from "."
Fetching gem metadata from https://rubygems.org/...........
...
Using sqlite3 (1.3.7)
Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.
        rake    db:create
    generate    refinery:cms --fresh-installation
      remove  public/index.html
...
Copied migration 20130214142233_create_seo_meta.seo_meta_engine.rb from seo_meta_engine
        rake  db:create db:migrate
...
        rake  db:seed
    ============================================================================
    Your new Refinery CMS application is now installed and mounts at '/'
  ============================================================================
         run  bundle install
...
Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.

=== ACTION REQUIRED ===
Now you can launch your webserver using:

cd mycms
rails server

This will launch the built-in webserver at port 3000.
You can now see Refinery running in your browser at http://localhost:3000/refinery

Thanks for installing Refinery CMS, we hope you enjoy crafting your application!
 ---------

action@my-cms-1422:~/workspace$ cd mycms
action@my-cms-1422:~/workspace/mycms$ rails server
=> Booting WEBrick
=> Rails 3.2.11 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
[2013-02-14 14:25:46] INFO  WEBrick 1.3.1
[2013-02-14 14:25:46] INFO  ruby 1.9.3 (2013-01-15) [x86_64-linux]
[2013-02-14 14:25:46] INFO  WEBrick::HTTPServer#start: pid=653 port=3000
  • メニューから Preview>Port 3000 を選択

出来てた

管理画面トップ

f:id:quattro_4:20130215002221p:plain

公開側ページ

f:id:quattro_4:20130215002248p:plain

  • ここまで10分はかかってない
  • またエディタ(IDE)使ってない
  • $ gem installはちょっと時間かかった
  • Refinery CMSの全自動っぷりにびびった

スタイルが変だったので今度こそエディタを

Refineryドキュメントもちろん初めて見たけど
RailsGuidesチックですばらしい

  • Action.ioに戻り、Consoleにカーソルをあて、Control + C でサーバー停止
  • エディタを開き ~/workspace/mycms/app/assets/stylesheets/application.css を開く
  • 5.4 Styling your viewscssコードをコピー
  • Action.ioのエディタのapplication.cssの末尾に貼り付け
  • Consoleにカーソルを戻し $ rails server
  • メニューから Preview>Port 3000 を選択

f:id:quattro_4:20130215002309p:plain

デザインが適用された
ついにエディタも使えた
コードハイライトまでするなんてすごい

Action.ioにも感動したが
Refinery CMSにも感動した

Refineryのスクリーンショットをいくつか

管理者ログイン

f:id:quattro_4:20130215002352p:plain

ページ管理

f:id:quattro_4:20130215002408p:plain

ページ編集

画像アップロードも標準搭載

f:id:quattro_4:20130215002417p:plain

日本語UIもありそうな