AbstractController::ActionNotFound (Действие 'show' не найдено для UserSessionsController):

У меня есть некоторые проблемы с моим приложением ruby. Я использую: Ruby = 2.0 Rails = 3.2

Когда я пытаюсь выйти из системы, у меня появляется ошибка, подобная этой ниже.

AbstractController:: ActionNotFound - Не удалось найти действие 'show' для UserSessionsController: actionpack (3.2.17) lib/abstract_controller/base.rb:116:in process' actionpack (3.2.17) lib/abstract_controller/rendering.rb:45:inПакет действий пакета (3.2.17) lib/action_controller/metal.rb:203:in dispatch' actionpack (3.2.17) lib/action_controller/metal/rack_delegation.rb:14:inдиспетчерский пакет действий (3.2.17) lib/action_controller/metal.rb:246:in block in action' actionpack (3.2.17) lib/action_dispatch/routing/route_set.rb:73:inдиспетчерский пакет действий (3.2.17) lib/action_dispatch/routing/route_set.rb:36:in call' journey (1.0.4) lib/journey/router.rb:68:inблок в вызове 'путешествие (1.0.4) lib/ trip / router.rb: 56: in call' actionpack (3.2.17) lib/action_dispatch/routing/route_set.rb:608:incall 'bullet (4.1.4) lib / bullet / rack.rb: 8: in call' hirefire-resource (0.1.2) lib/hirefire/middleware.rb:27:inвызов ' newrelic_rpm (3.6.2.96) lib/new_relic/rack/error_collector.rb:12:in call' newrelic_rpm (3.6.2.96) lib/new_relic/rack/agent_hooks.rb:18:inвызов 'newrelic_rpm (3.6.2.96) lib / new_relic / rack / browser_monitoring.rb: 16: in call' newrelic_rpm (3.6.2.96) lib/new_relic/rack/developer_mode.rb:28:incall 'request_store (1.0.5) lib / request_store / middleware.rb: 9: in call' actionpack (3.2.17) lib/action_dispatch/middleware/best_standards_support.rb:17:incall 'rack (1.4.5) lib / rack / etag.rb: 23: in call' rack (1.4.5) lib/rack/conditionalget.rb:25:incall 'actionpack (3.2.17) lib / action_dispatch / middleware / head.rb: 14: in call' actionpack (3.2.17) lib/action_dispatch/middleware/params_parser.rb:21:incall 'actionpack (3.2.17) lib / action_dispatch / middleware / flash.rb: 242: in call' rack (1.4.5) lib/rack/session/abstract/id.rb:210:incontext 'rack (1.4.5) lib / rack / session / abstract / id.rb: 205: in call' actionpack (3.2.17) lib/action_dispatch/middleware/cookies.rb:341:incall 'activerecord (3.2.17) lib / active_record / query_cache.rb: 64: in call' activerecord (3.2.17) lib/active_record/connection_adapters/abstract/connection_pool.rb:479:incall 'actionpack (3.2.17) lib / action_dispatch / middleware / callbacks.rb: 28: in block in call' activesupport (3.2.17) lib/active_support/callbacks.rb:405:inзапустите_4032778647788681780_вызов_3401891405258349156__callbacks' activesupport (3.2.17) lib/active_support/callbacks.rb:405: в __run_callback' activesupport (3.2.17) lib/active_support/callbacks.rb:385:inactivesupport _run_call_callbacks (3.2.17) lib / active_support / callbacks.rb: 81: in run_callbacks' actionpack (3.2.17) lib/action_dispatch/middleware/callbacks.rb:27:incall 'actionpack (3.2.17) lib / action_dispatch / middleware / reloader.rb: 65: in call' actionpack (3.2.17) lib/action_dispatch/middleware/remote_ip.rb:31:inвызовите 'better_errors (0.9.0) lib / better_errors / middleware.rb: 84: in protected_app_call' better_errors (0.9.0) lib/better_errors/middleware.rb:79:inbetter_errors_call 'better_errors (0.9.0) lib / better_errors / middleware.rb: 56: in call' actionpack (3.2.17) lib/action_dispatch/middleware/debug_exceptions.rb:16:incall 'actionpack (3.2.17) lib / action_dispatch / middleware / show_exceptions.rb: 56: in call' railties (3.2.17) lib/rails/rack/logger.rb:32:incall_app 'railties (3.2.17) lib / rails / rack / logger.rb: 16: in block in call' activesupport (3.2.17) lib/active_support/tagged_logging.rb:22:intagged 'railties (3.2.17) lib / rails / rack / logger.rb: 16: in call' actionpack (3.2.17) lib/action_dispatch/middleware/request_id.rb:22:incall 'rack (1.4.5) lib / rack / metadoverride.rb: 21: in call' rack-contrib (1.1.0) lib/rack/contrib/runtime.rb:18:incall 'activesupport (3.2.17) lib / active_support / cache / стратегии / local_cache.rb: 72: в call' rack (1.4.5) lib/rack/lock.rb:15:incall 'actionpack (3.2.17) lib / action_dispatch / middleware / static.rb: 63: in call' railties (3.2.17) lib/rails/engine.rb:484:incall 'railties (3.2.17) lib / rails / application.rb: 231: in call' rack (1.4.5) lib/rack/content_length.rb:14:incall 'railties (3.2.17) lib / rails / rack / log_tailer.rb: 17: в call' rack (1.4.5) lib/rack/handler/webrick.rb:59:inслужба ' /usr/local/rvm/rubies/ruby-2.0.0-p451/lib/ruby/2.0.0/webrick/httpserver.rb:138:in service' /usr/local/rvm/rubies/ruby-2.0.0-p451/lib/ruby/2.0.0/webrick/httpserver.rb:94:inвыполните ' /usr/local/rvm/rubies/ruby-2.0.0-p451/lib/ruby/2.0.0/webrick/server.rb:295:in `block in start_thread'

Это мой route.rb:

root to: 'user_session#new'
match '/user_sessions/new' => redirect('/user_session/new')
enter code here
controller :user_sessions do
get    'user_session/new'     => :new,  as: 'new_user_session'
get    'user_session/edit'    => :edit, as: 'edit_user_session'
get    'user_session'         => :show, as: 'user_session'
put    'user_session'         => :update
delete 'user_session'         => :destroy
post   'user_session'         => :create
end

И также поместите это в user_session_controller.rb

def destroy
current_user_session.destroy
redirect_to new_user_session_url
end

0 ответов

Другие вопросы по тегам