Permalink
Browse files

ensure that active tabs work dynamically t:20m

  • Loading branch information...
1 parent b4e5e9d commit f1d3056c2cf8f5caec90a52cbea1b9b479bac9d6 Will McNeilly committed Sep 19, 2011
@@ -28,16 +28,19 @@ def show
end
def my
+ @filter = "my_links"
@filtered_links = Link.by_session_id(session[:session_id])
@link = Link.new
end
def recent
+ @filter = "recent"
@filtered_links = Link.recent
@link = Link.new
end
def popular
+ @filter = "popular"
@filtered_links = Link.popular
@link = Link.new
end
@@ -26,9 +26,9 @@
</div>
<div class="container">
<ul class="link-nav <%= " #{@filter}" %>">
- <li><%= link_to "My Squishes", my_links_path, {:remote => true}, {:class => "my_links"} %></li>
- <li><%= link_to "Recently Squished", recent_links_path, {:remote => true}, {:class => "recent"} %></li>
- <li><%= link_to "Popular Squishes", popular_links_path, {:remote => true}, {:class => "popular"} %></li>
+ <li><%= link_to "My Squishes", my_links_path, {:class => "my_links", :remote => true} %></li>
+ <li><%= link_to "Recently Squished", recent_links_path, {:class => "recent", :remote => true} %></li>
+ <li><%= link_to "Popular Squishes", popular_links_path, {:class => "popular", :remote => true} %></li>
</ul>
<%= yield %>
@@ -1 +1,2 @@
-$('.link-table').html("<%= escape_javascript(render(:partial => "links", :locals => { :links => @filtered_links })) %>");
+$('.link-table').html("<%= escape_javascript(render(:partial => "links", :locals => { :links => @filtered_links })) %>");
+$('.link-nav').removeClass().addClass('my_links link-nav');
@@ -1 +1,2 @@
-$('.link-table').html("<%= escape_javascript(render(:partial => "links", :locals => { :links => @filtered_links })) %>");
+$('.link-table').html("<%= escape_javascript(render(:partial => "links", :locals => { :links => @filtered_links })) %>");
+$('.link-nav').removeClass().addClass('popular link-nav');
@@ -1 +1,2 @@
-$('.link-table').html("<%= escape_javascript(render(:partial => "links", :locals => { :links => @filtered_links })) %>");
+$('.link-table').html("<%= escape_javascript(render(:partial => "links", :locals => { :links => @filtered_links })) %>");
+$('.link-nav').removeClass().addClass('recent link-nav');

0 comments on commit f1d3056

Please sign in to comment.