Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
A Ruby on Rails plugin providing some super simple helpers.
Ruby
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
doc
lib
rails
spec
.gitignore
README
Rakefile
rails_basic_helpers.gemspec
rails_basic_helpers.gemspec.erb

README

A Ruby on Rails plugin providing some super simple helpers.

=== Examples

  rows = 
  [
    %w{John john@domain.com}, 
    %w{Doe doe@domain.com}
  ]
  
  table(rows)
  
  # <table>
  #   <tr>
  #     <td>John</td>
  #     <td>john@domain.com</td>
  #   </tr>
  #   <tr>
  #     <td>Doe</td>
  #     <td>doe@domain.com</td>
  #   </tr>
  # </table>
  
  table([%w{Name E-mail}] + rows, :headers => true)
  table(rows, :headers => %w{Name E-mail})
  
  # <table>
  #   <thead>
  #     <tr>
  #       <th>Name</th>
  #       <th>E-mail</th>
  #     </tr>
  #   </thead>
  #   <tr>
  #     <td>John</td>
  #     <td>john@domain.com</td>
  #   </tr>
  #   <tr>
  #     <td>Doe</td>
  #     <td>doe@domain.com</td>
  #   </tr>
  # </table>

  @people = 
  [
    Person.new('John', 'john@domain.com'), 
    Person.new('Doe', 'doe@domain.com')
  ]

  table(:people, %w{name email})

  # <table>
  #   <tr>
  #     <td>John</td>
  #     <td>john@domain.com</td>
  #   </tr>
  #   <tr>
  #     <td>Doe</td>
  #     <td>doe@domain.com</td>
  #   </tr>
  # </table>

  table(rows, [:name, :email], :headers => true)

  # <table>
  #   <thead>
  #     <tr>
  #       <th>Name</th>
  #       <th>Email</th>
  #     </tr>
  #   </thead>
  #   <tr>
  #     <td>John</td>
  #     <td>john@domain.com</td>
  #   </tr>
  #   <tr>
  #     <td>Doe</td>
  #     <td>doe@domain.com</td>
  #   </tr>
  # </table>
Something went wrong with that request. Please try again.