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 8678689
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T20:47:13+00:00 2026-06-12T20:47:13+00:00

I am new to Sinatra. I work currently on a project that is supposed

  • 0

I am new to Sinatra.

I work currently on a project that is supposed to use a array,

for example: ary = ['a','b','c']

to covert it into an HTML table (possible using an .erb file).

The table should have a single column with as many rows, as there are strings (dynamic).

for example:

  • a
  • b
  • c
  • (any other item of the array)

I don’t really have a clue how to do that and I tried code from similar projects, that didn’t work. I hope its even possible to do.

  • 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-12T20:47:14+00:00Added an answer on June 12, 2026 at 8:47 pm

    In the controller do

    get '/something' do
      @ary = ['a','b','c']
      erb :'something'
    end
    

    In the view named something you can do

    <table>
    <% @ary.each do |elem| %>
      <tr>
        <td>
          <%= elem %>
        </td>
      </tr>
    <% end %>
    </table>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm very new to Ruby and using Sinatra, mainly so that I can do
I'm trying to pass data between blocks using sinatra. For example: @data = Hash.new
I am using datamapper in a Sinatra application. I currently use the command DataMapper.finalize.auto_upgrade!
This is just for my weekend project/study, I am very new to Sinatra and
I'm trying to integrate the Rack OAuth-2 server into my sinatra application, to use
I have a project that uses Sinatra for static pages and Rails for the
I am pretty new to Sinatra and am making a simple todo app that
I'm new to Sinatra and I'm trying to figure out how querying a collection
I'm new to ruby, sinatra and padrino, so it might be a silly question,
I’m relatively new to Ruby, Sinatra, and DataMapper, but have a question about DataMapper

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.