Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8725745
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T08:06:11+00:00 2026-06-13T08:06:11+00:00

For early development, I typically build out a static version of the site. Previously

  • 0

For early development, I typically build out a static version of the site. Previously I’d use PHP and have something like…

images
javascripts
stylesheets
templates
-- header.php
-- footer.php
index.php
users.php

And the index.php and users.php would have some basic PHP include code for those header and footer files.

I also got the added benefit of being able to use a few PHP functions.

But I haven’t used PHP for anything in ages and use Ruby almost exclusively…so I’m wondering, is there a way to pull off something really basic like this in Ruby?

Primarily looking for something that allows me to:

  1. Do basic file includes (so I can create simple templates)
  2. Run Ruby inside the files

Ideally I could also use LiveReload with it.

Additional details: I’m running this locally on OS X and I typically use Pow as a server.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T08:06:12+00:00Added an answer on June 13, 2026 at 8:06 am

    Peter is right to recommend Sinatra. There are typically two types of Sinatra applications. Modular and classical. For your example, I’ll create a classical application. It isn’t much work to convert it to a modular if you find that style would better fit your needs.

    You’ll want to install the gem with gem install sinatra. Create a new directory for your project and two new files as follows:

    # app.rb
    require 'sinatra'
    
    get '/' do
      erb :index
    end
    
    # config.ru
    require './app'
    run Sinatra::Application
    

    Create another directory called views and add this file:

    # index.erb
    Hello World!
    

    Then type ruby app.rb and viola, you now have a working project on localhost:4567/.
    To serve static files like css and js, just create a public directory. From there, any file will be able to accessed after the root url. So if you created a css folder, its respective url would be: yourdomain.com/css/styles.css.

    So the entire directory would be as folllows:

    app/
      app.rb
      config.ru
      public/
        css/
        js/
        images/
      views/
        index.erb
    

    Between the Sinatra Book and the read me, you should be able to find all the info you need.

    To accomplish the templates, you’ll need something called Sinatra Partial.

    I’m not too familiar LiveReload but it seems like Compass accomplishes the same thing and has great integration with Sinatra. So long as pow is a rack based, you should have no problem using it.

    Here is a Sinatra Bootstrap I use for all my projects. It has Compass and Sinatra Partial preconfigured and makes it really easy to deploy with Heroku. It also uses Slim, Coffeescript, Thin (as the server), Twitter Bootstrap and Sass but it shouldn’t be too much work to sub that with your respective favorites or remove them all together.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In the early days of the iPhone development apps are often kicked out of
I'm early in development on a web application built in VS2008. I have both
What is the early development history of the .Net framework? (Before the release of
My project is in early development. I frequently delete the database and run manage.py
In early phases of software development projects the conceptual data model is designed. In
I'm working on early designs for an application that needs to start out small
I am in the early stages of development of a device requiring USB connectivity.
I'm in early development stage of developing a web application. Im currently reviewing as
I'm trying to use jQuery's controls in Software AG webMethods development IDE .. Now
What's your advice/points for developers to follow or avoid in the development and early

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.