Redirect To The Topics List After Creating A New Topic
Goals
Steps
Step 1: Change the topics controller
format.html { redirect_to @topic, notice: 'Topic was successfully created.' }format.html { redirect_to topics_path, notice: 'Topic was successfully created.' }def create @topic = Topic.new(topic_params) respond_to do |format| if @topic.save format.html { redirect_to topics_path, notice: 'Topic was successfully created.' } format.json { render :show, status: :created, location: @topic } else format.html { render :new } format.json { render json: @topic.errors, status: :unprocessable_entity } end end endformat.html { redirect_to @topic, notice: 'Topic was successfully updated.' }format.html { redirect_to topics_path, notice: 'Topic was successfully updated.' }Step 2: Confirm your changes
Explanation
Next Step:
Go on to Make The Topic Title A Link