私はほとんどそこにいて、simple_private_messages プラグインの残りの部分を理解しようとしています。この問題を解決する方法を知っている人はいますか?
これが私のレーキルートの出力です
delete_selected_user_messages POST /users/:user_id/messages/delete_select
ed(.:format) messages#delete_selected
user_messages GET /users/:user_id/messages(.:format)
messages#index
POST /users/:user_id/messages(.:format)
messages#create
new_user_message GET /users/:user_id/messages/new(.:format)
messages#new
edit_user_message GET /users/:user_id/messages/:id/edit(.:fo
rmat) messages#edit
user_message GET /users/:user_id/messages/:id(.:format)
messages#show
PUT /users/:user_id/messages/:id(.:format)
messages#update
DELETE /users/:user_id/messages/:id(.:format)
messages#destroy
users GET /users(.:format)
users#index
POST /users(.:format)
users#create
new_user GET /users/new(.:format)
users#new
edit_user GET /users/:id/edit(.:format)
users#edit
user GET /users/:id(.:format)
users#show
PUT /users/:id(.:format)
users#update
DELETE /users/:id(.:format)
users#destroy
これが私のroutes.dbです
resources :users do
resources :messages do
collection do
post :delete_selected
end
end
end
ActiveAdmin.routes(self)
devise_for :admin_users, ActiveAdmin::Devise.config
resources :users do
member do
get :following, :followers
end
end
resources :sessions, only: [:new, :create, :destroy]
resources :microposts, only: [:create, :destroy]
resources :relationships, only: [:create, :destroy]
resources :microposts do
resources :comments
end
root to: 'static_pages#home'
ここに私の _sent.html.erb があります
<h2>Sent</h2>
<table>
<tr>
<th>Delete?</th>
<th>Subject</th>
<th>To</th>
<th>Sent</th>
</tr>
<% if @messages.size == 0 %>
<tr>
<td colspan="4">
No messages
</td>
</tr>
<% else %>
<% for message in @messages %>
<tr>
<td><%= check_box_tag "delete[]", message.id %></td>
<td><%= link_to h(message.subject), user_message_path(@user, message) %></td>
<td><%= link_to h(message.recipient_id), user_path(message.recipient) %></td>
<td><%=h message.created_at.to_s(:long) %></td>
</tr>
<% end %>
<tr>
<td colspan="4">
<%= submit_tag "Delete" %>
</td>
</tr>
<% end %>
</table>
<%= link_to "Inbox", user_messages_path(@user)%>
このリンクを機能させようとしています (localhost:3000/users/2/messages?mailbox=sent) が、このエラー メッセージが表示されます
Routing Error
No route matches {:action=>"show", :controller=>"users"}