redmine 読み (3)

残りの以下を掘削。

  • app/views/welcome/index.html.erb
  • app/controllers/application_controller.rb

app/views/welcome/index.html.erb

こいつを yield するのは app/views/layouts/base.html.erb ですね。どっかにメモしましたが app/controllers/application_controllers.rb で layout 指定されてたはず。
いくつか、なんとなく使途は分かるのですが見たことない表現がありますね。

<h2><%= l(:label_home) %></h2>

とか

  <%= textilizable Setting.welcome_text %>

とか

    <%= link_to l(:label_news_view_all), :controller => 'news' %>

とか

  <%= call_hook(:view_welcome_index_left, :projects => @projects) %>

とか、やっぱ順に確認した方が良いですね。

  • Home な部分の記述
  • News な部分の記述
  • Projects な部分の記述
  • content_for :header_tags な部分の記述
Home な部分の記述

む、以下は locale 云々なソレのみ、なのか。

<h2><%= l(:label_home) %></h2>

ここはラベルだけで demo.redmine.org で言う以下な記述 (一部のみ) は

This is the online Redmine demo for uses to test Redmine and its features. All the data here is temporary and may be reset at any time.

以下で出力している模様。

<div class="splitcontentleft">
  <%= textilizable Setting.welcome_text %>

設定に welcome_text というソレがあるのかな。admin 持ってないので見れぬ。

おそらくは設定のソレは textile で云々、ということなのか。

News な部分の記述

基本的には以下でまかなっている模様。

    <%= render :partial => 'news/news', :collection => @news %>

ええと、app/views/news/_news.html.erb になるのかな。つうかこれ、rails3 だともっと簡単に書けるよ的ドキュメントも見かけたりしたんですが凄いな。
:collection なソレは @news に格納されてるオブジェクトについて繰り返し、を略した記述なんだと理解してるのですがそれで良いのかな。これはこれですばら。

すばらなドキュメント

これ、ちょっと確認入れてみます。

続きは別途、ということにて。