Permalink
Browse files

Issue 2947: show fandom when fandom doesn't exist

  • Loading branch information...
1 parent 48a9cfb commit 410a751edb4bf3c454f6ae3269e72739409d7f23 @CristinaRO CristinaRO committed Mar 4, 2012
Showing with 6 additions and 2 deletions.
  1. +4 −0 app/controllers/fandoms_controller.rb
  2. +2 −2 app/views/fandoms/show.html.erb
@@ -29,6 +29,10 @@ def index
def show
@fandom = Fandom.find_by_name(params[:id])
+ if @fandom.nil?
+ flash[:error] = ts("Could not find fandom named %{fandom_name}", :fandom_name => params[:id])
+ redirect_to media_path and return
+ end
@characters = @fandom.characters.canonical.by_name
end
@@ -4,8 +4,8 @@
<!--subnavigation, sorting and actions-->
<ul class="navigation actions" role="navigation">
- <li><%= link_to "Works", tag_works_path(@fandom) %></li>
- <li><%= link_to "Bookmarks", tag_bookmarks_path(@fandom) %></li>
+ <li><%= link_to ts("Works"), tag_works_path(@fandom) %></li>
+ <li><%= link_to ts("Bookmarks"), tag_bookmarks_path(@fandom) %></li>
</ul>
<!--subnav-->

0 comments on commit 410a751

Please sign in to comment.