store ip address and current user with incoming links

make links long an readable in share dialog
This commit is contained in:
Sam
2013-04-26 16:18:41 +10:00
parent a56a926582
commit f9e33ec6b8
10 changed files with 80 additions and 43 deletions

View File

@ -11,8 +11,7 @@ class PostsController < ApplicationController
def short_link
post = Post.find(params[:post_id].to_i)
user = User.select(:id).where(id: params[:user_id].to_i).first
IncomingLink.add(request, user ? user.id : nil)
IncomingLink.add(request,current_user)
redirect_to post.url
end