Comments (13)
For people using HAML, the shortcut for html_safe
is !=
:
!= pagy_nav(@pagy)
from pagy.
First, I'd like to mention I have been impressed with the amount and polish of the documentation. It speaks a lot to the care for the gem.
I, however, ended up finding this issue trying to figure out why I was having HTML tags show up on my index page instead of the nav bar.
I'm using slim, and my issue went away when I changed = pagy_nav(@pagy)
to = pagy_nav(@pagy).html_safe
as grosser recommends in his example. [Quick Start suggests <%== pagy_nav(@pagy) %>
]
Even when I switch my view from slim to erb, I still see the same issue.
I'm newer to Ruby and Rails. Did I do something wrong? I'm guessing more detail should be added to the Quick Start? (or some bug fixed?).
from pagy.
from pagy.
Right! Will do! Thanks.
from pagy.
Hey! I just remembered that I did that long ago :).
What about this Quick Start. Does that count as an example or it is just "all talk"?
from pagy.
@grosser closing this. Please, reopen if needed.
from pagy.
The example I posted is as long as the easy to use
section and shows all the basics, so I'd prefer that.
Atm people that come in and copy-paste things get 2 undefined method errors and then escaped html, also they need to figure out how to set the page-size, which afaik most users will need.
from pagy.
Atm people that come in and copy-paste things get 2 undefined method errors and then escaped html
Not sure to understand what you say: html copy and paste works from the browser without picking any html char, what are the 2 undefined method error?
Page size will be moved right after the example, so it will read as part of the same thing Thanks for that.
from pagy.
Ah, wait, I see now that I'm short a =
. Switching from = pagy_nav(@pagy)
(slim) to == pagy_nav(@pagy)
resolves my issue. I see now that the Quick Start shows 2 =
's. I mistakenly removed one when I ported to slim.
from pagy.
@dwieringa yes, that is the template equivalent of html_safe
from pagy.
I had figured that the ==
was a typo in the docs. It'd be helpful to know that was intentional and functionally identical to .html_safe
. Great gem, thanks for your hard work.
from pagy.
@aaronbrethorst Yes, that's something long due (also suggested by others) that I always forgot to add. Will do.
BTW, while the <%==
or equivalent is embedded in the template system and is agnostic to the type of app you use, the html_safe
is a specific ActiveSupport
method, hence is not agnostic and not so consistent with pagy.
from pagy.
@ddnexus got it. thanks again!
from pagy.
Related Issues (20)
- Docs: Which branch should PRs be made against? HOT 3
- Docs: Update performance metrics HOT 5
- Trim doesn't call with pagy_nav_js when first page is active
- Bug: Adapt with Mongoid add extention HOT 1
- Bug: Pagy::Backend#pagy_get_vars `count_args` gets ignored HOT 3
- Docs: https://ddnexus.github.io/pagy/quick-start/#configure HOT 1
- Bug: Missing initializer in documentation HOT 1
- Bug: wrong number of arguments (given 2, expected 0) HOT 2
- Bug: wrong number of arguments (given 2, expected 0) HOT 1
- Bug: Pagy not working with Geocoder gem
- Bug: Undocumented backwards-incompatible change of empty "page" parameter introduced in 6.4.0 HOT 3
- Docs: lost section about wrap existing pagination with pagy_calendar HOT 1
- Bug: Request for Pagy Gem: Making Commands Platform Independent HOT 1
- Bug: Pagy 8.4.0 is broken with MS SQL server HOT 18
- Bug: Only Limit 1 Query HOT 3
- Documentation: `anchor_string` option in `pagy_bootstrap_nav` (example from documentation) doesn't appear to be working HOT 1
- Docs: Some improvements in the documentation
- Bug: pagy_nav does not support `fragment` HOT 1
- Bug: Crashes when running rails server after upgrade HOT 2
- Bug: Anchor_string does not apply to disabled anchors HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pagy.