After further tinkering I realized that is passing the array. The
routing error was within the action, not the creation of the test
post. Sorry for the list traffic.
-Stephanie
On Jun 20, 4:35 pm, stephanie
<ginorm...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> Hi,
>
> I have a html form with check boxes. When the user chooses one or more
> check boxes, an array is passed as a parameter to the controller.
>
> in html form page...
> <input type=''checkbox''
name=''myarray[]'' value=''<%= value %>''
checked/>
> <%= name %> <br/>
>
> in controller
> params[:myarray] # this in an array of all the values checked
>
> This works great, but I am having trouble replicating the post in my
> tests. Does anybody know how to pass an array in a post test?
>
> This gives me a routing error...
>
> post :create, {:myarray => [''value1,
''value2''] }
>
> Thanks,
> Stephanie
--~--~---------~--~----~------------~-------~--~----~
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
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---