Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add a rough page to show the user their links.

  • Loading branch information...
commit 388e6cd52ab71cfc65f5296877506ace42628d36 1 parent 44a3343
@leenookx authored
View
10 app/controllers/user_controller.rb
@@ -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
View
23 app/views/user/links.html.erb
@@ -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>
Please sign in to comment.
Something went wrong with that request. Please try again.