I have a form that is passing a “date” to a controller and I need to
just get access to the date?
Here is a snippet from the form
Trade Date
<%= date_select 'trade', 'tradedate', :order => [:month, :day,
:year]%>
Symbol
<%= text_field 'position', 'symbol' %>
Here is a snippet from the table definition
class Trades < ActiveRecord::Migration
def self.up
create_table :trades do |table|
table.column :tradedate, :date
…
end
Here is snippet in the controller where I am attempting as follows
@position.trades.create( :tradedate => params[:trade],
:symbol => @position.symbol,
…
I can see in the log that it’s passing the parameter as follows
“trade”=>{“tradedate(1i)”=>“2006”, “tradedate(2i)”=>“11”,
“tradedate(3i)”=>“1”}
thanks for any help …