@@ -16,11 +16,12 @@ steps {
1616
1717 message "Find the line:"
1818
19- source_code :ruby, "format.html { redirect_to @topic, :notice => 'Topic was successfully created.' }"
19+ source_code :ruby, "format.html { redirect_to @topic, notice: 'Topic was successfully updated.' }"
20+
2021
2122 message 'and change `@topic` to `topics_path` like this:'
2223
23- source_code :ruby, "format.html { redirect_to topics_path, : notice => 'Topic was successfully created.' }"
24+ source_code :ruby, "format.html { redirect_to topics_path, notice: 'Topic was successfully created.' }"
2425
2526 message 'so that the file looks like this:'
2627
@@ -30,11 +31,11 @@ def create
3031
3132 respond_to do |format|
3233 if @topic.save
33- format.html { redirect_to topics_path, : notice => 'Topic was successfully created.' }
34- format.json { render : json => @topic, : status => :created, : location => @topic }
34+ format.html { redirect_to topics_path, notice: 'Topic was successfully created.' }
35+ format.json { render json: @topic, status: :created, location: @topic }
3536 else
36- format.html { render : action => "new" }
37- format.json { render : json => @topic.errors, : status => :unprocessable_entity }
37+ format.html { render action: "new" }
38+ format.json { render json: @topic.errors, status: :unprocessable_entity }
3839 end
3940 end
4041end
6263explanation {
6364
6465 message <<-MARKDOWN
65- * `format.html { redirect_to topics_path, : notice => 'Topic was successfully created.' }`:
66+ * `format.html { redirect_to topics_path, notice: 'Topic was successfully created.' }`:
6667 * `format.html` means that the server should send html back to the browser
6768 * `redirect_to topics_path` means show the **topics list page** when we're done creating a topic
68- * `: notice => 'Topic was successfully created.'` puts the message into the flash so it will be displayed on the topics list
69+ * `notice: 'Topic was successfully created.'` puts the message into the flash so it will be displayed on the topics list
6970 MARKDOWN
7071}
7172
0 commit comments