← Back to Upcase

Single Page website

(Paul Gatt) #1

Hi I was wondering what the best way to do the view for a single page website similar to http://2012.buildconf.com . It’s not an app as such, just one long website with navigation linking to each section. Currently I have one home controller which instantiates all the sections to the section instance variables and one long view! The page navigation is called from a helper so I don’t repeat myself, and I guess I could break each section out into it’s own partial, but isn’t that just creating a junk drawer.

(Ben Orenstein) #2

For very simple sites such as these, I’ll often use Sinatra over Rails.

If you think it might grow in the future (they usually do), and would prefer to use Rails, I’d check out high_voltage: https://github.com/thoughtbot/high_voltage

We made it for dealing with almost exactly this situation.

(Paul Gatt) #3

Thanks Ben,

I have looked at the High Voltage gem and used it for one or two static pages. Does it have functionality to help break down a really long page with multiple logical sections, or would you recommend just having a long view page or breaking out the logical sections into partials?

(Ben Orenstein) #4

I usually break long pages apart into partials (this isn’t part of high_voltage, it’s built into Rails).

(Paul Gatt) #5

Cool Ben, that’s what I thought. Much appreciated.