Permalink
Browse files

Improved UI for Short Term Goals

Changed the Short Term Goals Index page to include the long term goal they are associated with for ease of use.
  • Loading branch information...
kcalmes committed Mar 14, 2012
1 parent 71b64d0 commit 79522b57af3e5ed2218a398773ec422b4c7b05cf
Showing with 6 additions and 3 deletions.
  1. +3 −0 app/models/short_term_goal.rb
  2. +1 −1 app/models/user.rb
  3. +2 −2 app/views/short_term_goals/index.html.erb
@@ -4,6 +4,9 @@ class ShortTermGoal < ActiveRecord::Base
belongs_to :tag
belongs_to :user
+ def display_long_term_goals
+ self.long_term_goals.select(:name).map{|obj| obj.name}.join(',')
+ end
# TOKEN PROCESSING FOR AUTO-COMPLETE
def set_long_term_goals=(ids)
self.long_term_goal_ids = ids.split(",")
View
@@ -16,7 +16,7 @@ def display_name
if not self.firstname.blank?
self.firstname << " " << self.lastname
else
- "#{self.net_id}"
+ self.net_id
end
end
end
@@ -6,7 +6,7 @@
<tr>
<th>Name</th>
<th>Description</th>
- <th>School year</th>
+ <th>Long Term Goals</th>
<th></th>
<th></th>
<th></th>
@@ -21,7 +21,7 @@
<tr>
<td><%= short_term_goal.name %></td>
<td><%= short_term_goal.description %></td>
- <td><%= short_term_goal.school_year %></td>
+ <td><%= short_term_goal.display_long_term_goals %></td>
<td>
<%= link_to short_term_goal do %>
<button class="skin_colour round_all">

0 comments on commit 79522b5

Please sign in to comment.