diff --git a/app/assets/stylesheets/specific/meta_searches.css.scss b/app/assets/stylesheets/specific/meta_searches.css.scss
new file mode 100644
index 000000000..98133734d
--- /dev/null
+++ b/app/assets/stylesheets/specific/meta_searches.css.scss
@@ -0,0 +1,5 @@
+#c-meta-searches {
+ section {
+ margin-bottom: 2em;
+ }
+}
\ No newline at end of file
diff --git a/app/controllers/meta_searches_controller.rb b/app/controllers/meta_searches_controller.rb
new file mode 100644
index 000000000..c9fd25126
--- /dev/null
+++ b/app/controllers/meta_searches_controller.rb
@@ -0,0 +1,6 @@
+class MetaSearchesController < ApplicationController
+ def tags
+ @meta_search = MetaSearches::Tag.new(params)
+ @meta_search.load_all
+ end
+end
diff --git a/app/controllers/tag_aliases_controller.rb b/app/controllers/tag_aliases_controller.rb
index 67106a213..96a55ff8f 100644
--- a/app/controllers/tag_aliases_controller.rb
+++ b/app/controllers/tag_aliases_controller.rb
@@ -12,14 +12,6 @@ class TagAliasesController < ApplicationController
respond_with(@tag_alias)
end
- def general_search
- if params[:commit] == "Search Aliases"
- redirect_to tag_aliases_path(:search => {:name_matches => params[:query]})
- else
- redirect_to tag_implications_path(:search => {:name_matches => params[:query]})
- end
- end
-
def index
@search = TagAlias.search(params[:search])
@tag_aliases = @search.order("(case status when 'pending' then 0 when 'queued' then 1 else 2 end), antecedent_name, consequent_name").paginate(params[:page], :limit => params[:limit])
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index 2bbb33d59..c9083bc78 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -139,7 +139,7 @@ protected
when "artists", "artist_versions"
/^\/artist/
- when "tags"
+ when "tags", "meta_searches"
/^\/tags/
when "pools", "pool_versions"
diff --git a/app/logical/meta_searches/tag.rb b/app/logical/meta_searches/tag.rb
new file mode 100644
index 000000000..46eec97d3
--- /dev/null
+++ b/app/logical/meta_searches/tag.rb
@@ -0,0 +1,30 @@
+class MetaSearches::Tag
+ MAX_RESULTS = 25
+ attr_reader :search_params, :tags, :tag_aliases, :tag_implications
+
+ def initialize(search_params)
+ @search_params = search_params
+ end
+
+ def load_all
+ load_tags
+ load_tag_aliases
+ load_tag_implications
+ end
+
+ def load_tags
+ @tags = ::Tag.name_matches(name_param).limit(MAX_RESULTS)
+ end
+
+ def load_tag_aliases
+ @tag_aliases = TagAlias.name_matches(name_param).limit(MAX_RESULTS)
+ end
+
+ def load_tag_implications
+ @tag_implications = TagImplication.name_matches(name_param).limit(MAX_RESULTS)
+ end
+
+ def name_param
+ search_params[:name] || ""
+ end
+end
diff --git a/app/views/meta_searches/tags.html.erb b/app/views/meta_searches/tags.html.erb
new file mode 100644
index 000000000..21a3bffb3
--- /dev/null
+++ b/app/views/meta_searches/tags.html.erb
@@ -0,0 +1,129 @@
+
+
+<%= render "tags/secondary_links" %>
+
+<% content_for(:page_title) do %>
+ MetaSearch - Tags - <%= Danbooru.config.app_name %>
+<% end %>
\ No newline at end of file
diff --git a/app/views/tag_aliases/_secondary_links.html.erb b/app/views/tag_aliases/_secondary_links.html.erb
index b7fc8f59c..663069a99 100644
--- a/app/views/tag_aliases/_secondary_links.html.erb
+++ b/app/views/tag_aliases/_secondary_links.html.erb
@@ -1,6 +1,7 @@
<% content_for(:secondary_links) do %>