접근성 표준이 현재 페이지를 가리키는 링크 의 링크를 사용하지 못하도록하는 대신에 다음 코드를 리팩토링하는 방법을 생각해보십시오.haml 내의 refactor 조건보기
#navigation
%ul.tabbed
- if current_page?(new_profile_path)
%li{:class => "current_page_item"}
= link_to t("new_profile"), new_profile_path
- else
%li
= link_to t("new_profile"), new_profile_path
- if current_page?(profiles_path)
%li{:class => "current_page_item"}
= link_to t("profiles"), profiles_path
- else
%li
= link_to t("profiles"), profiles_path
...
감사합니다.
우수! 고맙습니다! P.S. : 함수에서 마지막 반환 값을 무시할 수 있다고 생각합니까? – user167267
사실입니다. 다른'return'과 대칭을 위해 그것을 추가했고 해쉬가 반환 값으로 존재했음을 강조했습니다. –