Skip to content

Commit

Permalink
[codeforamerica#18] Legacy articles URLs show "missing" partial when …
Browse files Browse the repository at this point in the history
…article not found
  • Loading branch information
Philip Hale committed Sep 1, 2013
1 parent 7f024bc commit 3f89d27
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/controllers/articles_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ def index
end
end

# GET /articles/1
# GET /articles/1.json
# redirect to the new paths (such as /quick_answers/1 instead of /articles/1)
def show
# redirect to the new paths (such as /quick_answers/1 instead of /articles/1)
return render(:template => 'articles/missing') unless Article.exists? params[:id]
@article = Article.find(params[:id])
return redirect_to @article, status: :moved_permanently
end

# This is what you would expect to be called CategoriesController#show
def article_type
@article_type = params[:content_type]
# convert paramaterized url
Expand Down

0 comments on commit 3f89d27

Please sign in to comment.