title: Render view from another controller with params
body: <p>I have code in my <strong>products_controller.rb</strong>   </p>
  
  <pre><code>        def create
            @product = Product.new(product_params)
            brand = Brand.find(params[:brand_id])
            @product.brand = brand
  
            if @product.save
              raise "OK"
            else
              @brand = Brand.find(params[:brand_id])
              render 'brands/show'
            end
          end
  </code></pre>
  
  <p>After failure of save method, i need to redirect to brands <strong>show.html.erb</strong> view, which find brand by id and display information about it.</p>
  
  <p><strong>Questions:</strong></p>
  
  <ol>
  <li>Is it right way of doing that</li>
  <li>If user manually passed server_id parameter, how can prevent it from executing (SQL injection)? Or how should i check and display error?</li>
  <li>How can i display errors in <code>brands/show</code> views outside form ( because i'm storing form in <code>&lt;a data-form="..."&gt;</code> property, so user can't see form until he clicks on link. Even more, i use <code>form_for([@brand,@brand.send(:products).klass.new])</code>)</li>
  </ol>