Skip to content

Conversation

@davbre
Copy link

@davbre davbre commented Apr 19, 2015

This relates to issue 13. You can exclude counts from results in the following ways:

class WidgetPresenter < Brainstem::Presenter
  presents "Widget"

  #1. exclude the count and do not allow counts to be requested
  exclude_count

  #2. exclude the count and allow counts to be requested in url, e.g. with "count=true"
  exclude_count allow: true


(etc)

end

If the exclude_count method is not used in the presenter definition, the count can be excluded using "count=false" in the url query string.

If you've any questions, just let me know. And by the way, nice gem :)

@cantino
Copy link
Contributor

cantino commented Apr 22, 2015

Hey @ivadnerb, thanks for the contribution! I'm at RailsConf right now, but I'll dig into this when I get back.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Brainstem still needs to support 1.9, so kwargs can't be used quite yet unfortunately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants