Szyny tworzące zniekształcone trasy z kropkami

Używam metod pomocnika ścieżki do generowania adresów URL w link_to i zwracają sformatowane adresy URL w następujący sposób:

http://localhost:3000/tweets.4

kiedy spodziewałem się, że zostaną sformatowane tak:

http://localhost:3000/tweets/4

Zauważ, jak używa kropki jako ogranicznika zamiast oczekiwanego ukośnika. Górny link nie rozwiązuje prawidłowego widoku, po prostu ładuje widok / tweety. Gdy ręcznie edytuję adres URL, aby był podobny do dołu, otwiera poprawne / tweety / show /.

Najbliższą rzeczą, jaką znalazłem w moich badaniach online, było to, że ludzie napotkali to z błędnie zagnieżdżonymi instrukcjami routingu - ale nie sądzę, żebym to robił tutaj.

Byłbym wdzięczny za wszelką pomoc lub wskazówki, które każdy może zapewnić!

Oto powiązane pliki źródłowe i informacje o wersji:

tweets / index.html.erb

<h1>Listing tweets</h1>

<% @tweets.each do |tweet| %>
<div>
    <!-- creates path in format of /tweets.2 -->
    <div><%= link_to tweet.status, tweets_path(tweet) %></div>

    <!-- creates path in the format of /user.1 -->
    <div><%= link_to tweet.user.name, users_path(tweet.user) %></div>   
</div>
<% end %>

tweets_controller.rb

class TweetsController < ApplicationController

  def index
    @tweets = Tweet.all
  end

  def show
    @tweet = Tweet.find(params[:id])
  end

  def new
    @tweet = Tweet.new
  end

  def create
    @tweet = Tweet.new(params[:tweet])
    @tweet.user = User.last

    if(@tweet.save)
      redirect_to :root
    end  
  end

  def edit
    @tweet = Tweet.find(params[:id])
  end

  def delete
  end

end

routes.rb

Zombietweets::Application.routes.draw do
  resources :tweets
  root :to => 'tweets#index'
end  

Gemfile

source 'https://rubygems.org'

gem 'rails', '3.2.9'

group :development, :test do
  gem 'sqlite3', '1.3.5'
  gem 'rspec-rails', '2.11.0'
end

group :assets do
  gem 'sass-rails',   '3.2.3'
  gem 'coffee-rails', '3.2.1'
  gem 'uglifier', '1.0.3'
end

gem 'jquery-rails', '2.0.2'

Używam Rails 3.2.9 i Ruby 1.9.3p327 (2012-11-10) [x86_64-darwin12.2.0]

questionAnswers(1)

yourAnswerToTheQuestion