On Tue, Dec 10, 2013 at 5:17 AM, Muhammad Nuzaihan Bin Kamal Luddin
<[email protected]> wrote:
> Hi All,
>
> I have this code in my controller.
>
> @accesspoint = Accesspoint.new(params[:accesspoint])
> @accesspoint.radgroupcheck_attributes = [{ :value =>
> params[:accesspoint][:shortname], :groupname => current_user.email }]
>
> It will not work, (I got an error "can't convert Symbol into Integer"
Wild guess: params[:accesspoint] returns an Array? You can check this with:
puts params[:accesspoint].class
p params[:accesspoint]
to see what it's actually returning. If it is in fact an array, then
calling [:shortname] on it would give that error, as this example
shows:
1.9.3p448 :001 > params = {:accesspoint => [1,2,3,4]}
=> {:accesspoint=>[1, 2, 3, 4]}
1.9.3p448 :002 > params[:accesspoint][:shortname]
TypeError: can't convert Symbol into Integer
Jesus.
--
You received this message because you are subscribed to the Google Groups
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sequel-talk.
For more options, visit https://groups.google.com/groups/opt_out.