title: rails pass parameters to 'new' method
body: <p>obviously I'm quite new to rails, so stick with me.</p>
  
  <p>I've added a constructor to my model</p>
  
  <pre><code>class Movie &lt; Media
    attr_accessible :director, :studio
    attr_accessor :director, :studio
  
    validates_presence_of :director, :studio, :title
    def initialize title, director, studio
      @title = title
      @director = director
      @studio = studio
    end
  end
  </code></pre>
  
  <p>and that sort of messed up things for me.
  Befor I've had a method 'new' in my controller like this</p>
  
  <pre><code>def new
      @movies = Movie.new
  end
  </code></pre>
  
  <p>and it worked nicely before the initialize came along. It requires parameters to be passed to the 'new' method, but that was done after a view was open for passing arguments from a user and saving them. Now I can't open that view because I get an error</p>
  
  <pre><code>wrong number of arguments (0 for 3)
  </code></pre>
  
  <p>The constructor was added due to the fact I started writting test for my application and setting default vaules for the constructor will nullify that test. Suggestion on solving this?</p>
  
  <p>EDIT:
  My tests look like this:</p>
  
  <pre><code>require 'spec_helper'
  
  describe Movie do
  
      before :each do 
          @movie = Movie.new "Bullet", "John", "20th"
      end
      describe "#{new}" do
          it "returns new object of Movie" do
              @movie.should be_an_instance_of Movie
          end
          it "throws ArgumentError when give less than 3 parameters" do
              lambda {Movie.new(:director =&gt; "John", :studio =&gt; "20th")}.should raise_exception ArgumentError
          end
      end
  
      describe "#title" do
          it "returns the correct title" do
              @movie.title.should eql "Bullet"
          end
      end
      describe "#director" do
          it "returns the correct director" do
              @movie.director.should eql "John"
          end
      end
      describe "#studio" do
          it "returns the correct studio" do
              @movie.studio.should eql "20th"
          end
      end
  end
  </code></pre>
  
  <p>Without that constructor all the tests fail....</p>