Advertisement
Guest User

Untitled

a guest
May 26th, 2016
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. class ProfilesController < ApplicationController
  2. def show
  3. @fullname = current_user.first_name + " " + current_user.last_name
  4. @recipes = current_user.recipes.page(params[:recipes_page]).order("created_at DESC")
  5. @favorites = current_user.favorites.page(params[:favorites_page]).order("created_at DESC")
  6. end
  7. end
  8.  
  9. $(function(){
  10.  
  11. $(".tab").on("click", function(e){
  12. // Change active tab
  13. $(".tab").removeClass('active');
  14. $(this).addClass("active");
  15. // Hide all tab-content (use class="hidden")
  16. $(".tab-content").addClass('hidden');
  17.  
  18. // Show target tab-content (use class="hidden")
  19. tabSelector = $(this).data("target");
  20. $(tabSelector).removeClass("hidden");
  21.  
  22. });
  23.  
  24. });
  25.  
  26. <div class="apple_pagination">
  27. <%= will_paginate @recipes, param_name: "recipes_page" %>
  28. </div>
  29.  
  30. <div class="apple_pagination">
  31. <%= will_paginate @favorites, param_name: "favorites_page" %>
  32. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement