mongoid/mongoid — Issue #1427: Field was defined as a(n) Array, but received a String with the value Array
Author: bartroza
Created: 2011-11-13 00:20:36+00:00
State: open

Mongoid does not recognize array. I use gem "mongoid", "~> 2.3".

```ruby
Parameters: {"utf8"=>"✓", "authenticity_token"=>"nehoT1fnza/ZW4XB4v27uZsfFjjOu/ucIhzMmMKgWPo=", "trip"=>{"title"=>"test", "description"=>"test", "waypoints"=>"[[52.40637,16.92517],[52.40601,16.925040000000003],[52.405750000000005,16.92493],[52.40514,16.92463],[52.404320000000006,16.924200000000003]]"}}

Completed 500 Internal Server Error in 1ms

Mongoid::Errors::InvalidType (Field was defined as a(n) Array, but received a String with the value "[[52.40637,16.92517],[52.40601,16.925040000000003],[52.405750000000005,16.92493],[52.40514,16.92463],[52.404320000000006,16.924200000000003]]".):
```
```ruby
class Trip
include Mongoid::Document
field :title, :type => String
field :description, :type => String
field :waypoints, :type => Array
end

class TripsController < ApplicationController
def create
@trip = Trip.new(params[:trip])
@trip.save
end
end
```