OSDN Git Service

now Problem#label returns string include level
authorokimoto <okimoto@good-day.co.jp>
Mon, 8 Mar 2010 06:04:36 +0000 (15:04 +0900)
committerokimoto <okimoto@good-day.co.jp>
Mon, 8 Mar 2010 06:04:36 +0000 (15:04 +0900)
app/models/problem.rb
app/views/admin/problems/index.html.erb

index 5713da1..ab933b2 100644 (file)
@@ -33,9 +33,8 @@ class Problem < ActiveRecord::Base
   validates_presence_of :options
 
 
-  # TODO remove this method
   def label
-    unit.name
+    "#{unit.name} Lv.#{level}"
   end
 
   def generate
index 2046e96..1bf0c7a 100644 (file)
@@ -7,7 +7,6 @@
     <tr>
       <th>ユニット</th>
       <th>レベル</th>
-      <th>ラベル</th>
       <th>操作</th>
     </tr>
   </thead>
@@ -16,7 +15,6 @@
       <tr>
         <td><%=h problem.unit.name %></td>
         <td><%=h problem.level %></td>
-        <td><%=h problem.label %></td>
         <td>
           <%= link_to _('Show'), admin_problem_path(problem.id) %>
           <%= link_to _('Edit'), edit_admin_problem_path(problem.id) %>