Cleyton Cleyton - 1 year ago 95
Ruby Question

Is there a way to get all the pages used by thoughtbot/high_voltage gem?

I'm using high_voltage gem for presenting some static files.

But, i need to list all of them to show in a dropdown.

Is there a way using the gem itself to get the dir and list the files?


Answer Source

No, not possible

The high_voltage gem does not have this capability. The whole point of the gem is to display "static views" without creating routes. It has no idea views exist unless it's viewed. If you desperately need this functionality, I would use ruby Dir and list the the files in a particular folder.

You could use Ruby to list all of the file in a directory. However... you'd still only have the paths of the files and not the meta-data (title, etc) from the pages. What is the use-case for this? Is it a sitemap? -- @harlow

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download