fixes #1579
This commit is contained in:
@@ -69,8 +69,6 @@ class WikiPagesController < ApplicationController
|
||||
@wiki_page = WikiPage.find_by_title(params[:title])
|
||||
if @wiki_page
|
||||
redirect_to wiki_page_path(@wiki_page)
|
||||
else
|
||||
redirect_to new_wiki_page_path(:wiki_page => {:title => params[:title]})
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ class WikiPage < ActiveRecord::Base
|
||||
belongs_to :creator, :class_name => "User"
|
||||
belongs_to :updater, :class_name => "User"
|
||||
validates_uniqueness_of :title, :case_sensitive => false
|
||||
validates_presence_of :title
|
||||
validates_presence_of :title, :body
|
||||
validate :validate_locker_is_janitor
|
||||
attr_accessible :title, :body, :is_locked
|
||||
has_one :tag, :foreign_key => "name", :primary_key => "title"
|
||||
|
||||
18
app/views/wiki_pages/show_or_new.html.erb
Normal file
18
app/views/wiki_pages/show_or_new.html.erb
Normal file
@@ -0,0 +1,18 @@
|
||||
<div id="c-wiki-pages">
|
||||
<div id="a-show">
|
||||
<%= render "sidebar" %>
|
||||
|
||||
<section id="content">
|
||||
<h1 id="wiki-page-title"><%= params[:title] %></h1>
|
||||
<div id="wiki-page-body" class="prose">
|
||||
<p>This wiki page does not exist. <%= link_to "Create new wiki page", new_wiki_page_path(:wiki_page => {:title => params[:title]}) %>.</p>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<% content_for(:page_title) do %>
|
||||
Wiki - <%= params[:title] %> - <%= Danbooru.config.app_name %>
|
||||
<% end %>
|
||||
|
||||
<%= render "secondary_links" %>
|
||||
Reference in New Issue
Block a user