/iqdb_queries: support both GET and POST; add GET /posts/1/similar.

This commit is contained in:
evazion
2016-12-23 01:33:40 -06:00
parent f2da569978
commit c402e15cca
2 changed files with 6 additions and 2 deletions

View File

@@ -2,7 +2,7 @@
class IqdbQueriesController < ApplicationController
before_filter :member_only
def create
def index
if !Danbooru.config.iqdbs_server
raise NotImplementedError.new("the IQDBs service isn't configured. Similarity searches are not available.")
end
@@ -16,6 +16,9 @@ class IqdbQueriesController < ApplicationController
end
end
# Support both POST /iqdb_queries and GET /iqdb_queries.
alias_method :create, :index
protected
def create_by_url
@download = Iqdb::Download.new(params[:url])