저는 breadcrumbs on rails을 내 프로젝트에 사용하고 있습니다.
rails g devise User
rake db:migrate
rails generate devise:views users
내 registration_controller.rb은 다음과 같습니다 :
# app/controllers/registrations_controller.rb
class RegistrationsController < Devise::RegistrationsController
add_breadcrumb "home", :root_path
add_breadcrumb "contact", :contacts_path
end
내가 변경 경로 :
devise_for :users, :controllers => { registrations: 'registrations' }
당신은 유증과 사용자 모델을하지 않았다면
먼저 해당합니다
application.html.erb 레이아웃에서 breadcrumbs를 추가했습니다 (바로 < % = yield %>)
<%= render_breadcrumbs %>
방금 테스트 해본 결과 스크린 샷에서 볼 수있는 것처럼 작동합니다.
편집 :
# app/controllers/passwords_controller.rb
class PasswordsController < Devise::PasswordsController
add_breadcrumb "home", :root_path
add_breadcrumb "contact", :contacts_path
end
: 비밀번호 페이지를 잊어 버렸 예를 들어 당신이 고안 보석의 다른 페이지에 빵 부스러기를 추가 할 경우
는, 당신은 새로운 컨트롤러를 만들 수 있습니다
경로를 업데이트하십시오.
devise_for :users, controllers: {
registrations: 'registrations',
passwords: 'passwords'
}
그것이 효과가 있는지 알려주십시오.
이동 경로를 추가하는 방법에 대해 암호를 잊으셨습니까? 및 기타 devise 페이지? 나는 그들이 일하도록 할 수 없다. –
@JoeGuerra 내 수정 된 답변을 확인하고 도움이되는지 알려주세요. – Blackcoat77
고마워, 그 효과가있는 것 같다. 기본적으로 routes 테이블의 경로를 확인하고 새 경로의 컨트롤러를 만든 다음 경로 구성 파일에 추가합니다. –