fixes #843
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
class UploadsController < ApplicationController
|
class UploadsController < ApplicationController
|
||||||
before_filter :member_only
|
before_filter :member_only
|
||||||
|
after_filter :save_recent_tags, :only => [:create]
|
||||||
respond_to :html, :xml, :json, :js
|
respond_to :html, :xml, :json, :js
|
||||||
rescue_from Upload::Error, :with => :rescue_exception
|
rescue_from Upload::Error, :with => :rescue_exception
|
||||||
|
|
||||||
@@ -43,4 +44,13 @@ class UploadsController < ApplicationController
|
|||||||
@upload.process!
|
@upload.process!
|
||||||
respond_with(@upload)
|
respond_with(@upload)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
protected
|
||||||
|
def save_recent_tags
|
||||||
|
if @upload
|
||||||
|
tags = Tag.scan_tags(@upload.tag_string)
|
||||||
|
tags = TagAlias.to_aliased(tags) + Tag.scan_tags(cookies[:recent_tags])
|
||||||
|
cookies[:recent_tags] = tags.uniq.slice(0, 40).join(" ")
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user