When I try and access the params, such as, by saying: params[:to][:3i],
ruby barks at me. All other variations have failed to get at the values.
So, my question is this: how in the name of everything holy am I
supposed to get the month, day, and year from the params hash when
hashes containing integers - 1, 2, 3, etc. - are inaccessable via ruby.
I have tried putting the values into a date object and everythign simply
does not work or come out as nil. Has anyone had any success at getting
at those values? Thanks,
3i],
at those values? Thanks,
Maybe I’m not understanding but why not access params[:post][:from]
and then request what parts you want using DateTime methods.
3i],
at those values? Thanks,
Maybe I’m not understanding but why not access params[:post][:from]
and then request what parts you want using DateTime methods.
it doesn’t complain when I do that but it doesn’t give any values back
either. If I try params[:to][:1i] it complains about the number, if I
try params[:to][“1i”] I get
You have a nil object when you didn’t expect it!
You might have expected an instance of ActiveRecord::Base.
The error occurred while evaluating nil.[]
3i],
at those values? Thanks,
Maybe I’m not understanding but why not access params[:post][:from]
and then request what parts you want using DateTime methods.
it doesn’t complain when I do that but it doesn’t give any values back
either. If I try params[:to][:1i] it complains about the number, if I
try params[:to][“1i”] I get
Your’re trying too hard. params[‘post’][‘to(1i)’] etc… (or use
select_date )
This may just be superstition talking, but I wonder if the problem is
the names “from” and “to”. Any difference if you make those, e.g.,
“from_date” and “to_date”?
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.