<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Rails 2.0 &#187; プラグイン</title>
	<atom:link href="http://rails20.jp/category/plugin/feed/" rel="self" type="application/rss+xml" />
	<link>http://rails20.jp</link>
	<description>Rails開発のTips、ソフトウェア、ライブラリに関する情報をお届けします。Railsの開発受託も行っています。</description>
	<lastBuildDate>Thu, 08 Oct 2009 04:14:44 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>ja</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Railsアプリケーションのデザインが決まらない時はWeb App Themeを使おう</title>
		<link>http://rails20.jp/2009/09/web_app_theme/</link>
		<comments>http://rails20.jp/2009/09/web_app_theme/#comments</comments>
		<pubDate>Mon, 28 Sep 2009 12:50:18 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[オープンソース]]></category>
		<category><![CDATA[プラグイン]]></category>
		<category><![CDATA[Github]]></category>
		<category><![CDATA[デザイン]]></category>

		<guid isPermaLink="false">http://rails20.jp/2009/09/web_app_theme/</guid>
		<description><![CDATA[開発者にとって一番難儀なのがデザインではないだろうか。いや、そうじゃないという人もいるだろうが筆者はそうだ。いつもデザインで悩んで、あげくの当てに放棄してしまう。そんな中、便利に使っているのがWeb App ThemeというRailsプラグインだ。HTMLファイルもあるのでRailsアプリケーションに限らず利用はできるが、ここではプラグインとして便利に使う方法を紹介したい。
まず最初はプラグインのインストールだ。

$ ruby script/plugin install git://github.com/pilu/web-app-theme.git
Initialized empty Git repository in #{RAILS_ROOT}/vendor/plugins/web-app-theme/.git/
remote: Counting objects: 72, done.
remote: Compressing objects: 100% (59/59), done.
remote: Total 72 (delta 15), reused 9 (delta 0)
Unpacking objects: 100% (72/72), done.
From git://github.com/pilu/web-app-theme
* branch HEAD -&#62; FETCH_HEAD

これだけでインストールは完了する。次にテーマの生成になる。

$ ./script/generate theme
exists app/views/layouts
create public/stylesheets/themes/default/
create app/views/layouts/application.html.erb
create public/stylesheets/web_app_theme.css
create public/stylesheets/web_app_theme_override.css
create public/stylesheets/themes/default/style.css

この状態でサーバを立ち上げてアクセスすると以下のように表示される（元々のindex.htmlは削除して、ルーティングの設定も変更されている必要がある）。なお、ファイルの内容は修正済なのでご注意いただきたい。


　
これが最も基本的なスタイルだ。次にテーマを変更する場合。テーマは全部で9種類用意されている。「bec-green」「bec」「blue」「djime-cerulean」「drastic-dark」「kathleene」「orange」「reidb-greenish」「warehouse」をテーマとして指定すれば良いだけだ。

$ ./script/generate theme &#8211;theme=blue
exists app/views/layouts
create public/stylesheets/themes/blue/
overwrite app/views/layouts/application.html.erb? (enter &#8220;h&#8221; for [...]]]></description>
			<content:encoded><![CDATA[<p>開発者にとって一番難儀なのがデザインではないだろうか。いや、そうじゃないという人もいるだろうが筆者はそうだ。いつもデザインで悩んで、あげくの当てに放棄してしまう。そんな中、便利に使っているのがWeb App ThemeというRailsプラグインだ。HTMLファイルもあるのでRailsアプリケーションに限らず利用はできるが、ここではプラグインとして便利に使う方法を紹介したい。</p>
<p>まず最初はプラグインのインストールだ。</p>
<blockquote>
<p>$ ruby script/plugin install git://github.com/pilu/web-app-theme.git</p>
<p>Initialized empty Git repository in #{RAILS_ROOT}/vendor/plugins/web-app-theme/.git/</p>
<p>remote: Counting objects: 72, done.</p>
<p>remote: Compressing objects: 100% (59/59), done.</p>
<p>remote: Total 72 (delta 15), reused 9 (delta 0)</p>
<p>Unpacking objects: 100% (72/72), done.</p>
<p>From git://github.com/pilu/web-app-theme</p>
<p>* branch HEAD -&gt; FETCH_HEAD</p>
</blockquote>
<p>これだけでインストールは完了する。次にテーマの生成になる。</p>
<blockquote>
<p>$ ./script/generate theme</p>
<p>exists app/views/layouts</p>
<p>create public/stylesheets/themes/default/</p>
<p>create app/views/layouts/application.html.erb</p>
<p>create public/stylesheets/web_app_theme.css</p>
<p>create public/stylesheets/web_app_theme_override.css</p>
<p>create public/stylesheets/themes/default/style.css</p>
</blockquote>
<p>この状態でサーバを立ち上げてアクセスすると以下のように表示される（元々のindex.htmlは削除して、ルーティングの設定も変更されている必要がある）。なお、ファイルの内容は修正済なのでご注意いただきたい。</p>
<p>
<a href="http://rails20.jp/wp-content/uploads/rails20/%E3%83%92%E3%82%9A%E3%82%AF%E3%83%81%E3%83%A3-143.png"><img src="http://rails20.jp/wp-content/uploads/rails20/%E3%83%92%E3%82%9A%E3%82%AF%E3%83%81%E3%83%A3-143-tm.jpg" width="440" height="303" alt="ピクチャ 143.png" /></a></p>
<p>　</p>
<p>これが最も基本的なスタイルだ。次にテーマを変更する場合。テーマは全部で9種類用意されている。「bec-green」「bec」「blue」「djime-cerulean」「drastic-dark」「kathleene」「orange」「reidb-greenish」「warehouse」をテーマとして指定すれば良いだけだ。</p>
<blockquote>
<p>$ ./script/generate theme &#8211;theme=blue</p>
<p>exists app/views/layouts</p>
<p>create public/stylesheets/themes/blue/</p>
<p>overwrite app/views/layouts/application.html.erb? (enter &#8220;h&#8221; for help) [Ynaqdh] Y</p>
<p>force app/views/layouts/application.html.erb</p>
<p>identical public/stylesheets/web_app_theme.css</p>
<p>identical public/stylesheets/web_app_theme_override.css</p>
<p>create public/stylesheets/themes/blue/style.css</p>
</blockquote>
<p>そうすれば次のようにテーマが変更されて表示される。</p>
<p>
<a href="http://rails20.jp/wp-content/uploads/rails20/%E3%83%92%E3%82%9A%E3%82%AF%E3%83%81%E3%83%A3-144.png"><img src="http://rails20.jp/wp-content/uploads/rails20/%E3%83%92%E3%82%9A%E3%82%AF%E3%83%81%E3%83%A3-144-tm.jpg" width="440" height="303" alt="ピクチャ 144.png" /></a></p>
<p>もしapplication.html.erbが嫌であれば、Layoutを指定して変更できる。</p>
<blockquote>
<p>$ ./script/generate theme application2 # ここではapplication2.html.erbを指定。</p>
<p>exists app/views/layouts</p>
<p>exists public/stylesheets/themes/default/</p>
<p>create app/views/layouts/application2.html.erb</p>
<p>identical public/stylesheets/web_app_theme.css</p>
<p>identical public/stylesheets/web_app_theme_override.css</p>
<p>identical public/stylesheets/themes/default/style.css</p>
</blockquote>
<p>これだけで手軽にテーマに対応したデザインができてしまう。デザイン自体、メニューがあったり、サブメニューがある、テーブルやフォームも考慮されており、さらにメッセージや2カラムフォームも利用できる。リストやログイン画面なども考慮されている等、デザインで厄介になりそうなポイントはきちんと押さえられている。これならば大抵のWebサイトの雛形として使えるのではないだろうか。</p>
<p>実際に使ってみた感じでは、フッターが左側のカラムについているので、幅広のフッターにしたい時にちょっと苦労するといった程度だ。それ以外はとても手軽に使えて、見栄えもよく、開発する気を損なわないで済む。デザインで苦労した経験のある方はぜひ使ってみて欲しいライブラリだ。</p>
<p>その他画面は詳細にて。</p>
<p><span id="more-68"></span></p>
<p>
<a href="http://rails20.jp/wp-content/uploads/rails20/%E3%83%92%E3%82%9A%E3%82%AF%E3%83%81%E3%83%A3-145.png"><img src="http://rails20.jp/wp-content/uploads/rails20/%E3%83%92%E3%82%9A%E3%82%AF%E3%83%81%E3%83%A3-145-tm.jpg" width="440" height="374" alt="ピクチャ 145.png" /></a><br />
<b>テキストとテーブル</b></p>
<p>　</p>
<p><a href="http://rails20.jp/wp-content/uploads/rails20/%E3%83%92%E3%82%9A%E3%82%AF%E3%83%81%E3%83%A3-146.png"><img src="http://rails20.jp/wp-content/uploads/rails20/%E3%83%92%E3%82%9A%E3%82%AF%E3%83%81%E3%83%A3-146-tm.jpg" width="440" height="374" alt="ピクチャ 146.png" /></a><br />
<b>フォームとメッセージ</b></p>
<p>　</p>
<p><a href="http://rails20.jp/wp-content/uploads/rails20/%E3%83%92%E3%82%9A%E3%82%AF%E3%83%81%E3%83%A3-148.png"><img src="http://rails20.jp/wp-content/uploads/rails20/%E3%83%92%E3%82%9A%E3%82%AF%E3%83%81%E3%83%A3-148-tm.jpg" width="440" height="374" alt="ピクチャ 148.png" /></a><br />
<b>1カラム</b></p>
<p>　</p>
<p>via <a href="http://www.moongift.jp/2009/06/web_app_theme/">Webシステム開発者に送る便利なテンプレート「Web App Theme」</a> [ MOONGIFT ]</p>
<p><b>pilu&#8217;s web-app-theme at master &#8211; GitHub</b><br />
　<a href="http://github.com/pilu/web-app-theme">http://github.com/pilu/web-app-theme</a></p>
<p></p>
]]></content:encoded>
			<wfw:commentRss>http://rails20.jp/2009/09/web_app_theme/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
