Error on link_to after deployment of Device

Asked 2 years ago, Updated 2 years ago, 87 views

Nice to meet you.

When you deploy device in Ruby on Rails and access localhost:3000/login, you get the error ActionController::UrlGenerationError in Device::Sessions#new.

Specifically, an error occurred in the link_to part of the page header.

</button>
    <ul class="list-group" id="menu-list">
    <lic class="list-group-item list-group-item-action">%=link_to "Test 1",:controller=>"career",:action=>"index"%>/li>
    <lic class="list-group-item list-group-item-action">%=link_to "Test 2",:controller=>"skill",:action=>"index"%>/li>
  </ul>
  </div>

The error is as follows, so the controller designation of link_to has been marked with device/ at the beginning, so if the URL is not found, the error appears.

No route matches {:action=>"index",:controller=>"device/career"}

By the way, the devise part of routes.rb looks like the following, and if you delete the above error part, the error will not occur and will transition to the login screen successfully.

device_for:users
  revise_scope —user do
    get 'login', to: 'device/sessions#new'
  end

What causes the device to be attached to the first part of the controller specification?
Also, what should I do to prevent the device from coming with it?

It may be elementary, but I would appreciate it if you could let me know.

ruby-on-rails ruby devise

2022-09-30 21:34

1 Answers

ActionController::UrlGenerationError in Device::Sessions#new has occurred - Ilsan no Ashikaru Programmer

Would this be helpful?

If you don't add /, you will probably go to find the controller in the device package.


2022-09-30 21:34

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.