I have a form that I want a date in. The date that the controller defines is @date_end. I want this date in the form, but without an AR model this seems REALLY STUPIDLY hard. I used to use this:
= date_select :date_end_, nil, :default => @date_end
But this only works if your ‘name’ is different from the instance var. If they are the same you get an ‘interning string’ error.
The only way I’ve found to solve this is to add a method to Object to return self
class Object
def get_self
self
end
end
Then I can do:
= date_select :date_end, :get_self
But we all know this is stupid. But there doesn’t seem to be another way…
Any suggestions?
Would something like this do the trick:
According to this documentation, under section “4.1 Barebones Helpers”, using this particular helper will create a series of select tags for the day, month year. The names should end up looking like “date_end[day]”, “date_end[month]”…etc. Let me know if that helps.