title: Rails - Creating multiple models in one controller
body: <p>This is more of a design then a technical issue..
  I'm pretty new to Rails and trying to follow it's guidelines:</p>
  
  <p>I have a a model called "Foo" along with "FooController" and a "UserForm.html.erb" to create new Foo objects which redirects to <code>FooController#create</code>..<br>
  When a user fills up a text field in the form and submits it the "create" action is called in the FooController class where the Foo model is persisted to the DB.</p>
  
  <p>Well this is all pretty simple until I added a new model called "Bar":<br>
  The bar model has nothing in common with "Foo" apart from the form that submits them both (The "UserForm.html.erb") now theres some logic and if a user enters a special string like "Create Bar!" then a Bar instance should be created and persisted.<br>
  At first I thought about creating a new BarController and redirecting to <code>BarController#create</code> from <code>FooController#create</code> using the <code>redirect_to</code> method if the input string is right but this just seems downright ugly..</p>
  
  <p>Something like this:</p>
  
  <pre><code>class FooController &lt; ApplicationController
     def create
        if(params[:user_input] != "CreateBar!"
           redirect_to bar_create_path
        else
           Foo.create()
     end
  end
  </code></pre>
  
  <p>So now I'm thinking about creating the Bar object in the <code>FooController#create</code> action but it's still a little bit weird to have a controller which is responsible for a single model to create some other model just because they are both bound by the View:</p>
  
  <pre><code>class FooController &lt; ApplicationController
     def create
        if(params[:user_input] != "CreateBar!"
           Bar.create()
        else
           Foo.create()
     end
  end
  </code></pre>
  
  <p>I guess both ways would work, but what is the right rails way? Maybe there is a third way i didn't thought about?</p>