Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Suite of FormHelpers for Sinatra

tag: v0.3.0

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 test
Octocat-spinner-32 .document
Octocat-spinner-32 .gitignore
Octocat-spinner-32 LICENSE
Octocat-spinner-32 README.rdoc
Octocat-spinner-32 Rakefile
Octocat-spinner-32 Rakefile.backup
Octocat-spinner-32 VERSION.yml
Octocat-spinner-32 sinatra-formhelpers.gemspec
README.rdoc

sinatra-formhelpers

sinatra-formhelpers is a suite of form helpers for sinatra.

link "google", "http://www.google.com"            # Returns "<a href='http://www.google.com'>google</a>"
label :person, :first_name         # Returns "<label for='person_first_name'>First Name</label>"
text :person, :first_name  # Returns "<input name='person[first_name]' id='person_first_name' value='' type='text' />"

There are also helpers for (area, submit, image, radio, checkbox, and select)

To install it, run:

sudo gem install twilson63-sinatra-formhelpers -s gems.github.com

To include it in a Sinatra application, write:

require 'rubygems'
require 'sinatra/formhelpers'

If you're subclassing Sinatra::Base, then you need to call helpers manually:

class MyApp < Sinatra::Base
  helpers Sinatra::FormHelpers
  # ...
end

Copyright

Copyright © 2009 twilson63. See LICENSE for details.

Something went wrong with that request. Please try again.