Ruby on Rails Thursday, January 15, 2015

On 15 January 2015 at 04:12, David Williams <lists@ruby-forum.com> wrote:
> These two functions below work perfectly for end to end normal user
> interaction. But, I need help giving line 2 of the code "recipients =
> User.where(id: params['recipients']) multiple user support. As in allow
> User model to interact with BizUser model.

What is BizUser?

Colin

>
> def create
> recipients = User.where(id: params['recipients'])
> conversation = current_user.send_message(recipients,
> params[:message][:body], params[:message][:subject]).conversation
> flash[:success] = "Message has been sent!"
> redirect_to conversation_path(conversation)
> end
>
> def recipients_options
> s = ''
> User.all.each do |user|
> s << "<option value='#{user.id}'
> data-img-src='#{gravatar_image_url(user.email, size:
> 50)}'>#{user.name}</option>"
> end
> s.html_safe
> end
>
> --
> Posted via http://www.ruby-forum.com/.
>
> --
> You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
> To post to this group, send email to rubyonrails-talk@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/124796b85709e25d2c1b111fa8104b16%40ruby-forum.com.
> For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAL%3D0gLvbSujqR3q-X_QLwTdLPtzd3KBR3Ygnz5xBY4aY82SYBQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment