回答編集履歴

1

色は指定の範囲からでしたね

2016/10/07 02:58

投稿

maisumakun
maisumakun

スコア145184

test CHANGED
@@ -4,11 +4,13 @@
4
4
 
5
5
  ```ruby
6
6
 
7
+ <% colors = %w|red green yellow #fcc| %>
8
+
7
9
  <% @notes.each do |note| %>
8
10
 
9
11
  <%= content_tag :div, class: :note,
10
12
 
11
- style: format("background-color: #%06X", rand(1<<24)) do %>
13
+ style: "background-color: #{colors.sample}" do %>
12
14
 
13
15
  <%= note.content %>
14
16