railsでユーザー一覧画面を作成中です。
ユーザー一覧の実装中に以下のエラーメッセージが発生しました。
発生している問題・エラーメッセージ
Routing Error No route matches [GET] "/users" Rails.root: /Users/system_name/yamaneco
該当のソースコード
rails
1get 'yamaneco/users/' => 'yamaneco/users#index'
rails
1<%= link_to("ユーザー一覧", "/users/", class: "yamaneco_btn") %>
rails
1class UsersController < ApplicationController 2 def index 3 User.all 4 end 5end
試したこと
/
を入れてみたり外してみたりしましたが、どうもそれではないようでした。
他には下記のようにnamespace
も入れてみましたがダメでした。
指定の仕方が間違っているのでしょうか?
rails
1 namespace :yamaneco do 2 get 'users/', to: 'yamaneco/users#index' 3 end
補足情報(FW/ツールのバージョンなど)
フォルダの構成は以下です。断層になっている場合は指定の仕方が違うのでしょうか?
│ └── views
│ ├── yamaneco
│ │ ├── index.html.erb
│ │ ├── posts
│ │ │ ├── detail.html.erb
│ │ │ ├── edit.html.erb
│ │ │ ├── index.html.erb
│ │ │ └── new.html.erb
│ │ └── users
│ │ └── index.html.erb
│ ├── layouts
│ │ ├── application.html.erb
│ │ ├── mailer.html.erb
│ │ └── mailer.text.erb
│ └── root
│ ├── about.html.erb
│ └── index.html.erb
よろしくお願いいたします。
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。