Module: Sinatra::Xeditable_Select::Helpers

Included in:
FormBuilder::Field
Defined in:
lib/sinatra/xeditable_select.rb

Instance Method Summary collapse

Instance Method Details

#get_xeditable_select(values, url, html_class) ⇒ Object

Create a Xeditable_Select::Select object

Parameters:

  • values

    hash with values for select

  • url

    to send information on change

  • html_class

    class to add to select



73
74
75
# File 'lib/sinatra/xeditable_select.rb', line 73

def get_xeditable_select(values, url, html_class)
  Select.new(values, url, html_class)
end

#get_xeditable_select_bool(url, html_class) ⇒ Object



77
78
79
80
81
82
# File 'lib/sinatra/xeditable_select.rb', line 77

def get_xeditable_select_bool(url, html_class)
  values = {'0' => ::I18n.t("No"),
            '1' => ::I18n.t("Yes")
  }
  Select.new(values, url, html_class)
end