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


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to