I am creating a charts application that shows data based on a date range, and I want to have the date range default to a 1 week interval when the application is first opened, and then give the user the option to set the date range to search for a longer or shorter range. Currently I am setting the date default to what the last entered date was, so once a date is entered, it the range will persist until changed again or until going back to the home page. I am new to Ruby as a whole, so the environment is still a bit confusing, but I am thinking that it would make the most sense to set the values in the controller, but I'm not sure quite how to do that or if that is even correct. So far, I have this:
index.html.erb (view)
Start Date <%= date_field_tag :start_date, params[:start_date], id:'start', class:'dateSel' %>
End Date <%= date_field_tag :end_date, params[:end_date], id:'end', class: 'dateSel' %>
welcome_controller.rb (controller)
start_date = params["start_date"]
end_date = params["end_date"]