related tags: build html server-side instead of client-side.

This commit is contained in:
evazion
2018-10-12 21:18:15 -05:00
parent 5a05961bde
commit 4e2944ee06
13 changed files with 134 additions and 271 deletions

View File

@@ -1,5 +1,5 @@
class ArtistUrlsController < ApplicationController
respond_to :json, :xml, :html
respond_to :js, :json, :xml, :html
before_action :member_only, except: [:index]
def index

View File

@@ -1,10 +1,9 @@
class RelatedTagsController < ApplicationController
respond_to :json
respond_to :html, :only=>[:show]
respond_to :json, :xml, :js, :html, except: [:update]
before_action :require_reportbooru_key, only: [:update]
def show
@query = RelatedTagQuery.new(params[:query].to_s.downcase, params[:category])
@query = RelatedTagQuery.new(params[:query], category: params[:category], translated_tags: params[:translated_tags], artists: params[:artists])
respond_with(@query) do |format|
format.json do
render :json => @query.to_json