Question: I have a controller called "products\_controllers.rb" that have this method:

```
def create
  ...
  ...
  respond_to do |format|
    if @product.save
     ???????
    else
      format.html { render :action => "new" }
      format.xml  { render :xml => @product.errors, :status => :unprocessable_entity }
    end
end

```

Whenever the product is save I want to redirect it to an specific view called "suppliers", that belongs to the product views, how can I do that?
Thanks in advance!

Answer: 
If you're using restful routes and there is a relationship where product has many suppliers, you could use:

```
format.html { redirect_to product_suppliers_url(@product) }

```

with something like this in your routes.rb:

```
map.resource :products do |product|
  product.resource :suppliers
end

```

or you could also just use this:

```
format.html { redirect_to :action => 'suppliers', :id => @product.id }

```
Something like 
`redirect_to 'product/suppliers'`

Source:
<http://guides.rubyonrails.org/layouts_and_rendering.html#using-redirect_to>

Comment: Next time make sure to specify "in rails" in the text of your question since views and controllers are used by many frameworks.