newbee question:
I have a form, where I want to add a choice of weekdays a movie is
playing into one field:
<%= select_tag ‘days[]’, options_for_select([[“monday”, “2”],
[“tuesday”, “3”], [“wednesday”, “4”], [“thursday”, “5”], [“friday”,
“6”], [“saturday”, “7”], [“sunday”, “1”]]),:multiple => true %>
how can I save days.join(",") into @movie.weekdays when I create a new
movie record?
def create
@movie = Movie.new(params[:movie])
respond_to do |format|
if @movie.save
flash[:notice] = ‘Movie was successfully created.’
format.html { redirect_to(movies_path) }
else
format.html { render :action => “new” }
end
end
end