DEV Community

Cover image for Dev.to Writing: Polls?!
Nathan Kallman
Nathan Kallman

Posted on

Dev.to Writing: Polls?!

Cover photo by Element5 Digital on Unsplash


Since @ben refused to answer my question on how to setup polls (like this one), I had to find out for myself!

There's no reference to it in any of the documentation... so I went to the source.

Digging into forem (the open source code that powers DEV) I found references to the poll liquid tag.

It's hard to infer just by looking at the code, but based on how tags work (and how I would implement it), I believe starting a poll on DEV looks something like so:

{% poll "Is this how you start a poll?" "Yes" "No" %}
Enter fullscreen mode Exit fullscreen mode

So I threw that into my post and:
Error message stating "Whoops, something went wrong: base User is not permitted to use this liquid tag

I guess those lines in the PollTag class are working:

  VALID_ROLES = %i[
    admin
    super_admin
  ].freeze
Enter fullscreen mode Exit fullscreen mode

And surprisingly it seems like I'm not an admin or a super_admin...

I guess until the almighty @ben and company decide to release such a magical feature to us unwashed masses we'll have to go about this another way:

If you think polls should become a widely available feature, react with a 🦄
If you think polls are a blessing only the elite should disseminate, react with a ❤️
If you want to check back in on the status of this poll, react with a 🔖


Thanks for reading!

If you have a question of your own about DEV, just ask in a comment. I read all of them and would love to add another post in this series that will actually help other writers in this awesome community!

Top comments (2)

Collapse
 
terabytetiger profile image
Tyler V. (he/him)

Ben talks about polls here:

and the Github issue can be found here - github.com/forem/forem/issues/1512 - although is hasn't had an update since Ben's post 😢

Collapse
 
kallmanation profile image
Nathan Kallman

Awesome! I must have missed that post, thanks!