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:indispatch' actionpack (3.2.17) lib/action_controller/metal/rack_delegation.rb:14:in
диспетчерский пакет действий (3.2.17) lib/action_controller/metal.rb:246:inblock 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:incall' journey (1.0.4) lib/journey/router.rb:68:in
блок в вызове 'путешествие (1.0.4) lib/ trip / router.rb: 56: incall' actionpack (3.2.17) lib/action_dispatch/routing/route_set.rb:608:in
call 'bullet (4.1.4) lib / bullet / rack.rb: 8: incall' 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:incall' 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: incall' newrelic_rpm (3.6.2.96) lib/new_relic/rack/developer_mode.rb:28:in
call 'request_store (1.0.5) lib / request_store / middleware.rb: 9: incall' actionpack (3.2.17) lib/action_dispatch/middleware/best_standards_support.rb:17:in
call 'rack (1.4.5) lib / rack / etag.rb: 23: incall' rack (1.4.5) lib/rack/conditionalget.rb:25:in
call 'actionpack (3.2.17) lib / action_dispatch / middleware / head.rb: 14: incall' actionpack (3.2.17) lib/action_dispatch/middleware/params_parser.rb:21:in
call 'actionpack (3.2.17) lib / action_dispatch / middleware / flash.rb: 242: incall' rack (1.4.5) lib/rack/session/abstract/id.rb:210:in
context 'rack (1.4.5) lib / rack / session / abstract / id.rb: 205: incall' actionpack (3.2.17) lib/action_dispatch/middleware/cookies.rb:341:in
call 'activerecord (3.2.17) lib / active_record / query_cache.rb: 64: incall' activerecord (3.2.17) lib/active_record/connection_adapters/abstract/connection_pool.rb:479:in
call 'actionpack (3.2.17) lib / action_dispatch / middleware / callbacks.rb: 28: inblock 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:in
activesupport _run_call_callbacks (3.2.17) lib / active_support / callbacks.rb: 81: inrun_callbacks' actionpack (3.2.17) lib/action_dispatch/middleware/callbacks.rb:27:in
call 'actionpack (3.2.17) lib / action_dispatch / middleware / reloader.rb: 65: incall' actionpack (3.2.17) lib/action_dispatch/middleware/remote_ip.rb:31:in
вызовите 'better_errors (0.9.0) lib / better_errors / middleware.rb: 84: inprotected_app_call' better_errors (0.9.0) lib/better_errors/middleware.rb:79:in
better_errors_call 'better_errors (0.9.0) lib / better_errors / middleware.rb: 56: incall' actionpack (3.2.17) lib/action_dispatch/middleware/debug_exceptions.rb:16:in
call 'actionpack (3.2.17) lib / action_dispatch / middleware / show_exceptions.rb: 56: incall' railties (3.2.17) lib/rails/rack/logger.rb:32:in
call_app 'railties (3.2.17) lib / rails / rack / logger.rb: 16: inblock in call' activesupport (3.2.17) lib/active_support/tagged_logging.rb:22:in
tagged 'railties (3.2.17) lib / rails / rack / logger.rb: 16: incall' actionpack (3.2.17) lib/action_dispatch/middleware/request_id.rb:22:in
call 'rack (1.4.5) lib / rack / metadoverride.rb: 21: incall' rack-contrib (1.1.0) lib/rack/contrib/runtime.rb:18:in
call 'activesupport (3.2.17) lib / active_support / cache / стратегии / local_cache.rb: 72: вcall' rack (1.4.5) lib/rack/lock.rb:15:in
call 'actionpack (3.2.17) lib / action_dispatch / middleware / static.rb: 63: incall' railties (3.2.17) lib/rails/engine.rb:484:in
call 'railties (3.2.17) lib / rails / application.rb: 231: incall' rack (1.4.5) lib/rack/content_length.rb:14:in
call '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:inservice' /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