Is there a way I can have a model that’s basically what would be used to
simply encapsulate some data?
Here’s my situation. I have a search form that contains name fields and
two date fields outputted using date_select. I created a Search model
but don’t have it tied to ActiveRecord. I’d like to do something like
the following:
Search Controller
…
@search = MySearch.new(@params[:search])
…
Search View
…
date_select “search”, “from_date”, :class => “text”, :start_year =>
2007, :order => [:month, :day, :year]
…
Problem is, since it isn’t tied to ActiveRecord so it’s not associated
with the database, I’m not sure how I’d go about creating the model to
work properly with the html helpers. I tried creating some local
variables using write_attribute but that’s part of ActiveRecord so it
won’t work.
Any ideas?