From 0bc55bec74f2d62d2053d09d9041b3022245f258 Mon Sep 17 00:00:00 2001 From: evazion Date: Mon, 3 Jul 2017 22:05:53 -0500 Subject: [PATCH] notes: redirect /notes/123 to /posts/456#note-123. --- app/controllers/notes_controller.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/controllers/notes_controller.rb b/app/controllers/notes_controller.rb index bed70f667..06e78a77b 100644 --- a/app/controllers/notes_controller.rb +++ b/app/controllers/notes_controller.rb @@ -17,7 +17,9 @@ class NotesController < ApplicationController def show @note = Note.find(params[:id]) - respond_with(@note) + respond_with(@note) do |format| + format.html { redirect_to(post_path(@note.post, anchor: "note-#{@note.id}")) } + end end def create