1

私は私のレーキルートにこれを持っています:

{:subdomain=>/m/, :action=>"destroy", :controller=>"mobile/home"}
                                                              mobile_disclosures GET    /disclosures(.:format)                                                                                                     {:subdomain=>/m/, :action=>"index", :controller=>"mobile/disclosures"}
                                                                                 POST   /disclosures(.:format)                                                                                                     {:subdomain=>/m/, :action=>"create", :controller=>"mobile/disclosures"}
                                                           new_mobile_disclosure GET    /disclosures/new(.:format)                                                                                                 {:subdomain=>/m/, :action=>"new", :controller=>"mobile/disclosures"}
                                                          edit_mobile_disclosure GET    /disclosures/:id/edit(.:format)                                                                                            {:subdomain=>/m/, :action=>"edit", :controller=>"mobile/disclosures"}
                                                               mobile_disclosure GET    /disclosures/:id(.:format)                                                                                                 {:subdomain=>/m/, :action=>"show", :controller=>"mobile/disclosures"}
                                                                                 PUT    /disclosures/:id(.:format)                                                                                                 {:subdomain=>/m/, :action=>"update", :controller=>"mobile/disclosures"}
                                                                                 DELETE /disclosures/:id(.:format)   

コントローラーを次の場所にリダイレクトしようとしています。mobile_disclosures

このようなことを試すことによって:

  redirect_to :controller=>'mobile_disclosures', :action => 'show'

しかし、エラーが発生しています。

{:controller => "mobile / mobile_disclosures"、:action=>"show"}に一致するルートはありません

私の構文の何が間違っているのか、どこが間違っているのか、何か考えはありますか?

4

1 に答える 1

4

ShowにはIDが必要なので、IDも渡す必要があります。

redirect_to :controller=>'mobile_disclosures', :action => 'show', :id => some_id
于 2012-04-24T18:00:04.093 に答える