-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
paginate() shows raw HTML with Slim template engine #73
Comments
Actually kaminari uses raw method in some files. $ grep -r raw .
./app/views/kaminari/_first_page.html.erb: <%= link_to_unless current_page.first?, raw(t 'views.pagination.first'), url, :remote => remote %>
./app/views/kaminari/_first_page.html.haml: = link_to_unless current_page.first?, raw(t 'views.pagination.first'), url, :remote => remote
./app/views/kaminari/_first_page.html.slim: == link_to_unless current_page.first?, raw(t 'views.pagination.first'), url, :remote => remote
./app/views/kaminari/_gap.html.erb:<span class="page gap"><%= raw(t 'views.pagination.truncate') %></span>
./app/views/kaminari/_gap.html.haml: = raw(t 'views.pagination.truncate')
./app/views/kaminari/_gap.html.slim: == raw(t 'views.pagination.truncate')
./app/views/kaminari/_last_page.html.erb: <%= link_to_unless current_page.last?, raw(t 'views.pagination.last'), url, {:remote => remote} %>
./app/views/kaminari/_last_page.html.haml: = link_to_unless current_page.last?, raw(t 'views.pagination.last'), url, {:remote => remote}
./app/views/kaminari/_last_page.html.slim: == link_to_unless current_page.last?, raw(t 'views.pagination.last'), url, {:remote => remote}
./app/views/kaminari/_next_page.html.erb: <%= link_to_unless current_page.last?, raw(t 'views.pagination.next'), url, :rel => 'next', :remote => remote %>
./app/views/kaminari/_next_page.html.haml: = link_to_unless current_page.last?, raw(t 'views.pagination.next'), url, :rel => 'next', :remote => remote
./app/views/kaminari/_next_page.html.slim: == link_to_unless current_page.last?, raw(t 'views.pagination.next'), url, :rel => 'next', :remote => remote
./app/views/kaminari/_prev_page.html.erb: <%= link_to_unless current_page.first?, raw(t 'views.pagination.previous'), url, :rel => 'prev', :remote => remote %>
./app/views/kaminari/_prev_page.html.haml: = link_to_unless current_page.first?, raw(t 'views.pagination.previous'), url, :rel => 'prev', :remote => remote
./app/views/kaminari/_prev_page.html.slim: == link_to_unless current_page.first?, raw(t 'views.pagination.previous'), url, :rel => 'prev', :remote => remote
./spec/fake_app.rb:app.routes.draw do I think it's much better and safer to replace #raw with #html_safe. I'm not sure if it solves your problem, but I will just work on it and send a pull request soon. |
I am running into the same issue when using slim template. I tried |
use "==" on your _paginator.html.slim file. see at https://github.com/derencius/kaminari_themes/blob/master/twitter-bootstrap/app/views/kaminari/_paginator.html.slim |
@yuki24 any update on that PR? 😈 |
@yuki24 I sent a PR for to use If I don't hear any objections in a few days I will merge it. |
I'm closing this issue in favor of #418. |
For future reference, the sample @derencius linked to is now located here. Reproduced here, just in case it gets moved or deleted: = paginator.render do
ul.pagination
== first_page_tag unless current_page.first?
== prev_page_tag unless current_page.first?
- each_page do |page|
- if page.left_outer? || page.right_outer? || page.inside_window?
== page_tag page
- elsif !page.was_truncated?
== gap_tag
== next_page_tag unless current_page.last?
== last_page_tag unless current_page.last? |
paginate() shows raw HTML with Slim template engine kaminari/kaminari#73
Well, I'm using Slim as my template engine, and whenever I put "=paginate(@videos)" it shows raw HTML instead of the actual links. I got it working with "=paginate(@videos).to_s.html_safe", but I think this shouldn't be the way kaminari should work...
Thanks anyway for your work!
The text was updated successfully, but these errors were encountered: