Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class ProfilesController < ApplicationController
- def show
- @fullname = current_user.first_name + " " + current_user.last_name
- @recipes = current_user.recipes.page(params[:recipes_page]).order("created_at DESC")
- @favorites = current_user.favorites.page(params[:favorites_page]).order("created_at DESC")
- end
- end
- $(function(){
- $(".tab").on("click", function(e){
- // Change active tab
- $(".tab").removeClass('active');
- $(this).addClass("active");
- // Hide all tab-content (use class="hidden")
- $(".tab-content").addClass('hidden');
- // Show target tab-content (use class="hidden")
- tabSelector = $(this).data("target");
- $(tabSelector).removeClass("hidden");
- });
- });
- <div class="apple_pagination">
- <%= will_paginate @recipes, param_name: "recipes_page" %>
- </div>
- <div class="apple_pagination">
- <%= will_paginate @favorites, param_name: "favorites_page" %>
- </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement