이 간단한 erb 코드는 완벽하게 작동하며 i18n.yml
파일에 연결됩니다. 아이디어는 클라이언트의 edit.html.erb
페이지를 가져 와서 해당 페이지의 제목을 내 en.yml
파일로 가져와 해당 제목을 @client.fullname
변수로 전달하는 것입니다. 좋아요 :레일 4는 슬림 에러가 발생합니다
<h1><%= t('client.edit.title'), :current_client => @client.fullname %></h1>
이제 저는 erb 파일을 슬림화하는 중입니다. 그래서 코드 줄의 결과는
h1 = t('client.edit.title'), :current_client => @client.fullname
입니다하지만 그것은 en.yml
파일에 변수를 전달 wouldnt한다. 대신이 오류가 발생합니다.
/app/views/clients/edit.html.slim:1: syntax error, unexpected ',', expecting ')' ...tty2 = (t('client.edit.title'), :current_client => @client.f... ...^
내가 잘못하고있는 것을 아는 사람이 있습니까?
h1
= t('client.edit.title'), :current_client => @client.fullname
유일한 방법을 제거 할 수 있습니다 : current_client => @ client.fullname) – paulorcdiniz
고마워, 너도 가지고있어! –