On Feb 25, 5:30 pm, Kenneth Lorthioir <[email protected]> wrote:
> Hello all,
>
> I can't understand why the following code keeps throwing the wrong
> number of arguments error. Even if I leave the function empty it still
> throws the error. What am I doing wrong?
>
You're overwriting a core ruby method (send)
Fred
> class SmsController < ApplicationController
> def send
> if params[:send] == "true"
> account = Twilio::RestAccount.new(TWILIO_CONFIG['ACCOUNT_SID'],
> TWILIO_CONFIG['ACCOUNT_TOKEN'])
>
> d = {
> 'From' => TWILIO_CONFIG['CALLER_ID'],
> 'To' => '1234567,
> 'Body' => 'Testing'
> }
>
> @resp = account.request("/#{TWILIO_CONFIG['API_VERSION']}/
> Accounts/#{TWILIO_CONFIG['ACCOUNT_SID']}/SMS/Messages", 'POST', d)
>
> @resp.error! unless @resp.kind_of? Net::HTTPSuccess
> end
> end
> end
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.