내 보석 파일에는 gem 'stringex'
이 있습니다. bundle install
을 실행 한 후 경로 도우미를 추가하고 stringex의 메서드를 사용하고 있습니다. 나는 to_url
문자열을 직접 사용할 수 있어야합니다. 예를 들어 stringex readme : "simple English".to_url => "simple-english"
. 나는 내 길 도우미에 문자열에서의 메소드 .to_url를 사용하려고하면올바른 보석이 설치되어 있어도 레일에 NoMethodError가 발생했습니다.
그러나, 내가 얻을 :
module PostsHelper
def post_path(post)
"/posts/#{post.id}/#{post.title.to_url}"
end
end
보석이 설치되지 않은 것 같습니다. 그 보석에 대한 참조를 수동으로 추가하려고 했습니까? –