From df7a25fffc1ed0eb1d80a2130d1b21b80e720ccb Mon Sep 17 00:00:00 2001 From: Arka Ganguli Date: Thu, 21 Jan 2016 21:04:52 -0500 Subject: [PATCH] super shitty comments fix for now --- app/assets/javascripts/flotr_nav.js | 2 ++ app/controllers/images_controller.rb | 2 ++ 2 files changed, 4 insertions(+) diff --git a/app/assets/javascripts/flotr_nav.js b/app/assets/javascripts/flotr_nav.js index 6e993c6..e4587d1 100644 --- a/app/assets/javascripts/flotr_nav.js +++ b/app/assets/javascripts/flotr_nav.js @@ -169,6 +169,7 @@ function nextPage(){ $('#info-title').text(data.title); $('#info-tag').text(data.tag); $("#more-rb").attr('href', '/tags/' + data.tag + '?page=1'); //this sucks + $("#link-rb").attr('href', '/images/' + data.id); //this sucks $('img[class="bg-img"]').attr({src: data.url}); } }); @@ -197,6 +198,7 @@ function prevPage(){ $('#info-title').text(data.title); $('#info-tag').text(data.tag); $("#more-rb").attr('href', '/tags/' + data.tag + '?page=1'); //this sucks + $("#link-rb").attr('href', '/tags/' + data.id); //this sucks $('img[class="bg-img"]').attr({src: data.url}); } }); diff --git a/app/controllers/images_controller.rb b/app/controllers/images_controller.rb index 9cf387b..1fd2e3e 100644 --- a/app/controllers/images_controller.rb +++ b/app/controllers/images_controller.rb @@ -7,6 +7,7 @@ def index @img = Hash.new @tags.each do |tag| + @img[:id] = tag.images.first.id @img[:url] = tag.images.first.image.url @img[:title] = tag.images.first.title @img[:tag] = tag.name @@ -27,6 +28,7 @@ def tags @img = Hash.new @images.each do |img| + @img[:id] = img.id @img[:url] = img.image.url @img[:title] = img.title @img[:tag] = params[:tag]