before_save :make_words_for_search
selectable_attr :font_size do
- entry "0", :xsmall, "25pt"
- entry "1", :small, "30pt"
- entry "2", :middle, "34pt"
- entry "3", :large, "39pt"
- entry "4", :xlarge, "44pt"
+ entry 0, :xsmall, "XSmall", :point => "25pt"
+ entry 1, :small, "Small", :point => "30pt"
+ entry 2, :middle, "Middle", :point => "34pt"
+ entry 3, :large, "Large", :point => "39pt"
+ entry 4, :xlarge, "XLarge", :point => "44pt"
end
RUBY_KANJI_HIRA = %r/([一-龠]+)\(([ぁ-ん]+)\)/
<%= f.error_messages %>
<table>
<tr>
- <th>コード(CODE)</th>
+ <th><%= f.label :code, 'コード(CODE)' %></th>
<td><%= f.select :code, Song::CODES, :include_blank => true %></td>
</tr>
<tr>
- <th>題名(TITLE)</th>
+ <th><%= f.label :title, '題名(TITLE)' %></th>
<td><%= f.text_field :title %></td>
</tr>
<tr>
- <th>歌詞(WORDS)</th>
+ <th><%= f.label :words, '歌詞(WORDS)' %></th>
<td><%= f.text_area :words, :size => "40x8" %></td>
</tr>
<tr>
- <th>出典(SOURCE)</th>
+ <th><%= f.label :copyrigyt, '出典(SOURCE)' %></th>
<td><%= f.text_field :copyright %></td>
</tr>
<tr>
- <th>表示サイズ(FONT SIZE)</th>
- <td><%= f.select :font_size, Song.font_size_options %></td>
+ <th><%= f.label :font_size, '表示サイズ(FONT SIZE)' %></th>
+ <td><%= f.select :font_size %></td>
</tr>
<tr>
<td colspan="2"><%= f.submit "保存する(SAVE)" %></td>
<%= button_to "このデータを削除する", @song, :confirm => '本当に削除しますか?', :method => :delete %>
[<%= link_to "表示", @song %>]
[<%= link_to "印刷用画面", print_song_path(@song) %>]
-[<%= link_to "トップに戻る", song_path %>]
+[<%= link_to "トップに戻る", songs_path %>]
[<%= link_to_function "ローマ字", "toRoman()" %>]
[<%= link_to_function "リセット", "reset()" %>]
<hr />
-
+<div id="song_preview" style="font-size:18pt; width:20em;border:solid gray 1px">
<%= format_words(@song) %>
+</div>
<%= javascript_include_tag "show_song" %>
<script type="text/javascript">
Event.observe(window, 'load', function() {
- init(<%= @song.font_size_name %>);
+ init('<%=j @song.font_size_entry[:point] %>');
});
</script>
<%- end -%>