beautify map invocations of users
This commit is contained in:
parent
1870276cd2
commit
e968919cce
4 changed files with 4 additions and 4 deletions
|
@ -4,7 +4,7 @@ class UsersController < ApplicationController
|
|||
def index
|
||||
@users = User.natural_search(params[:q])
|
||||
respond_to do |format|
|
||||
format.json { render :json => @users.map { |u| u.token_attributes } }
|
||||
format.json { render :json => @users.map(&:token_attributes) }
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
= t '.list.mail', email: mail_to(FoodsoftConfig[:mailing_list_subscribe])
|
||||
|
||||
#recipients
|
||||
= f.input :recipient_tokens, :input_html => { 'data-pre' => User.find_all_by_id(@message.recipients_ids).map { |u| u.token_attributes }.to_json }
|
||||
= f.input :recipient_tokens, :input_html => { 'data-pre' => User.find_all_by_id(@message.recipients_ids).map(&:token_attributes).to_json }
|
||||
= f.input :group_id, :as => :select, :collection => Group.undeleted.order('type DESC, name ASC').all.reject { |g| g.memberships.empty? }
|
||||
= f.input :private
|
||||
= f.input :subject, input_html: {class: 'input-xxlarge'}
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
= yield
|
||||
|
||||
= f.input :user_tokens, :as => :string,
|
||||
:input_html => { 'data-pre' => f.object.users.map { |u| u.token_attributes }.to_json }
|
||||
:input_html => { 'data-pre' => f.object.users.map(&:token_attributes).to_json }
|
||||
|
||||
- content_for :javascript do
|
||||
:javascript
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
= f.input :name
|
||||
= f.input :description, as: :text, input_html: {rows: 10}
|
||||
= f.input :duration, :as => :select, :collection => 1..3
|
||||
= f.input :user_list, :as => :string, :input_html => { 'data-pre' => @task.users.map { |u| u.token_attributes }.to_json }
|
||||
= f.input :user_list, :as => :string, :input_html => { 'data-pre' => @task.users.map(&:token_attributes).to_json }
|
||||
= f.input :required_users
|
||||
= f.association :workgroup
|
||||
= f.input :due_date, as: :date_picker
|
||||
|
|
Loading…
Reference in a new issue