foodsoft/app/views/shared/_group_form_fields.html.haml
2014-11-23 01:42:15 +01:00

21 lines
690 B
Text

= f.input :name
= f.input :description, as: :text, input_html: {rows: 4}
= captured if defined? captured
= f.input :user_tokens, :as => :string,
:input_html => { 'data-pre' => f.object.users.map(&:token_attributes).to_json }
- content_for :javascript do
:javascript
$(function() {
$("##{f.object.class.to_s.underscore}_user_tokens").tokenInput("#{users_path(:format => :json)}", {
crossDomain: false,
prePopulate: $("##{f.object.class.to_s.underscore}_user_tokens").data("pre"),
hintText: '#{t('.search_user')}',
noResultText: '#{t('.user_not_found')}',
searchingText: '#{t('.search')}',
theme: 'facebook'
});
});