views:

48

answers:

0

I have following code in my controller

  def create
    @employees = Group.find(params[:employee][:group_id]).employees
    puts "count!!!!" + @employees.count.to_s
    Communicate.deliver_message(params[:subject],@employees,params[:body].to_s)
    flash[:notice] = "your message has been sent"
    redirect_to root_url
  end

following code in Communicate model:

  def message(sub, people, msg)
    #puts "employee count!!!" + people.count
    subject    sub
    bcc        "[email protected]"
    from       '[email protected]'
    sent_on    Time.now

    body       :greeting => msg
  end

Error I am getting is "wrong number of arguments" on 3rd line of the create method.