My Web app has two date_select parameters in. These should be passed to the DB for searching later on. However I cannot get this to function. You see I can see from the inspection that the parameters being passed are date(3i) (2i) (1i). When I create my migrate file with my tables in it fails if I try to add (3i) etc.. I've read that in rails we need to manipulate this in the controller. I'm trying but failing miserably. I would have thought that this is basic attribute of a DB table. dates etc..
Any Pointers? What code do you need to see.
Here are the parameters I'm passing...
"date(3i)"=>"19",
"date(2i)"=>"4",
"date(1i)"=>"2014",
"date_of_change(3i)"=>"19",
"date_of_change(2i)"=>"4",
"date_of_change(1i)"=>"2014",
class CreatePosts < ActiveRecord::Migration
def change
create_table :posts do |t|
t.text :title
t.text :requester
t.text :requester_email
t.text :customer
t.text :contact
t.text :customer_email
t.text :customer_phone
t.string :type_of_change
t.timestamps
OK seem to be getting further here.... so on the rails console I can see the following date has been passed but the date_of_change is still nil.
=> #<Post id: 7, title: "", requester: "", requester_email: "", customer: "", contact:
customer_email: "", customer_phone: "", type_of_change: "Service Change", created_at:
"2014-04-19 21:32:53", updated_at: "2014-04-19 21:32:53", implementer: "", ticket: "",
date: "2014-04-19", date_of_change: nil>
OK. I have a typo on my permitted values. let me change that.