Created
March 2, 2011 21:18
-
-
Save LegendSzymonP/851765 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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