I installed the Kaminari
gem and followed the instructions. I customized my theme to the foundations
but when trying to further customize the pagination style using the en.yml
file, I run into this error:
I18n::InvalidLocaleData in Campaigns#index
can not load translations from /myapp/config/locales/en.yml: #<Psych::SyntaxError: (/myapp/config/locales/en.yml): did not find expected key while parsing a block mapping at line 23 column 3>
Extracted source (around line #2):
1 <li>
2 <%= link_to_unless current_page.first?, raw(t 'views.pagination.first'), url, :remote => remote %>
3 </li>
I simply copied and pasted what was in the docs..
en:
hello: "Hello world"
pagination:
first: "« First"
last: "Last »"
previous: "‹ Prev"
next: "Next ›"
truncate: "…"
If I delete everything other than pagination:
line, the error still remains. I'm not super familiar with the locale file in Rails as well as YAML files so any help is highly appreciated.
According to the results from YAML Lint, it appears that the
hello: "Hello world"
line is invalid.Also, it looks like the
views.pagination.first
line in your code is looking for a path like:views -> pagination -> first
in your YAML file (and because this pattern can't be found, there's another error).Therefore, it might be better to use this kind of YAML example: