Skip to content

Instantly share code, notes, and snippets.

@szymon-przybyl
Created March 2, 2011 21:18
Show Gist options
  • Save szymon-przybyl/851765 to your computer and use it in GitHub Desktop.
Save szymon-przybyl/851765 to your computer and use it in GitHub Desktop.
class MoviesController < ApplicationController
def index
end
def new
@movie = Movie.create
@genres = Genre.all
end
def create
Movie.create!(params[:movie].merge(:genres => Genre.find(params[:genres])))
redirect_to movies_path
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment