Class: Locomotive::ApiKeyInput
Instance Method Summary
collapse
#translate_from_namespace
Instance Method Details
#api_key_html ⇒ Object
10
11
12
13
|
# File 'app/inputs/locomotive/api_key_input.rb', line 10
def api_key_html
api_key = object.api_key || I18n.t('simple_form.labels.locomotive.account.no_api_key')
template.content_tag :code, api_key
end
|
6
7
8
|
# File 'app/inputs/locomotive/api_key_input.rb', line 6
def input(wrapper_options)
api_key_html + regenerate_button
end
|
15
16
17
18
19
20
21
22
23
|
# File 'app/inputs/locomotive/api_key_input.rb', line 15
def regenerate_button
url = options[:url]
template.content_tag :button, I18n.t('simple_form.buttons.locomotive.account.new_api_key'),
class: 'btn btn-default btn-sm form-control-button',
data: {
url: url,
confirm: I18n.t('locomotive.messages.confirm')
}
end
|