Permalink
Browse files

Add a rough page to show the user their links.

  • Loading branch information...
1 parent 44a3343 commit 388e6cd52ab71cfc65f5296877506ace42628d36 @leenookx committed Feb 27, 2011
Showing with 32 additions and 1 deletion.
  1. +9 −1 app/controllers/user_controller.rb
  2. +23 −0 app/views/user/links.html.erb
@@ -199,9 +199,17 @@ def feed
redirect_to root_url
end
else
- puts "Not logged in"
flash[:error] = "You are not logged in and cannot use this function."
redirect_to root_url
end
end
+
+ # ##################################################################
+ # Display the users recent URL list as a ATOM feed.
+ # ##################################################################
+ def links
+ if logged_in?
+ @user_links = UserLinks.find_all_by_user_id(@user.id, :limit => 20, :order => "updated_at desc")
+ end
+ end
end
@@ -0,0 +1,23 @@
+<h2>Your Spengalised Links</h2>
+
+<div id="links">
+<% if !@user_links.nil? %>
+ <table width="100%" cellspacing="2" cellpadding="2" align="left" border="0">
+ <% @user_links.each do |link| %>
+ <tr>
+ <td>
+ <%= link_to "#{link.url}", "#{link.title}" %>
+ </td>
+ <td>
+ <%= "link description goes here" %>
+ </td>
+ <td>
+ <%= "link keywords" %>
+ </td>
+ </tr>
+ <% end %>
+ </table>
+<% else %>
+ <p>You have not spengalised anything.</p>
+<% end %>
+</div>

0 comments on commit 388e6cd

Please sign in to comment.