Module: Sinatra::CountryHelpers

Defined in:
lib/sinatra/support/countryhelpers.rb

Overview

Country helpers.

require 'sinatra/support/countryhelpers'
require 'sinatra/support/htmlhelpers'

class Main < Sinatra::Base
  helpers Sinatra::HtmlHelpers
  helpers Sinatra::CountryHelpers
end

Helpers

Provides the following helpers:

country_choices - Country choices for select_options.

<!-- A dropdown box of countries. -->
<select name="country">
  <%= select_options country_choices %>
</select>

Instance Method Summary collapse

Instance Method Details

#country_choicesObject



25
26
27
# File 'lib/sinatra/support/countryhelpers.rb', line 25

def country_choices
  Sinatra::Country.to_select
end