railsbridge/docs — pull request #258 by Sue-Young (2013-10-21 02:58:29+00:00)
Title: modified update to redirect_to topics_path to avoid bug: duplicate flash...

... messages on show page

The instructions have the student change 'redirect_to @topic' to 'redirect_to topics_path' in the topics_controller#create method. Then they are told to add a flash message to 'app/views/layouts/application.html.erb'.

After this, when doing an edit, the call to topics_controller#update still has 'redirect_to @topic', which goes to the show page. In this view, there are now two copies of the flash message. One from the show.html and one from the application.html.

Both edit and create should return to the topics_path, so I updated the instructions to have the student make both changes. The bug in the show page is thus avoided.

Alternatively, the student could have been instructed to remove the duplicate flash message display lines from show.html, but changing both create and update to be symmetric seems more correct.

![screen shot 2013-10-20 at 8 50 16 pm](https://f.cloud.github.com/assets/5296952/1369663/ff812b0c-39fb-11e3-8a8c-c216358e3d2d.png)