From a70fce91c09027c9acdd288055eb3a62268819ec Mon Sep 17 00:00:00 2001 From: Toks Date: Sun, 7 Jul 2013 19:56:59 -0400 Subject: [PATCH] add artist link on new wiki pages --- app/controllers/wiki_pages_controller.rb | 1 + app/views/wiki_pages/show_or_new.html.erb | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/controllers/wiki_pages_controller.rb b/app/controllers/wiki_pages_controller.rb index 153b5f8ad..f9fa10e6f 100644 --- a/app/controllers/wiki_pages_controller.rb +++ b/app/controllers/wiki_pages_controller.rb @@ -71,6 +71,7 @@ class WikiPagesController < ApplicationController redirect_to wiki_page_path(@wiki_page) else @wiki_page = WikiPage.new(:title => params[:title]) + @artist = Artist.name_matches(@wiki_page.title).first respond_with(@wiki_page) end end diff --git a/app/views/wiki_pages/show_or_new.html.erb b/app/views/wiki_pages/show_or_new.html.erb index e17483f89..0d8d3d47a 100644 --- a/app/views/wiki_pages/show_or_new.html.erb +++ b/app/views/wiki_pages/show_or_new.html.erb @@ -8,10 +8,13 @@

This wiki page does not exist. <%= link_to "Create new wiki page", new_wiki_page_path(:wiki_page => {:title => params[:title]}) %>.

+ <% if @artist %> +

<%= link_to "View artist", @artist %>

+ <% end %> + <%= wiki_page_alias_and_implication_list(@wiki_page)%> <%= wiki_page_post_previews(@wiki_page) %> -