class ProductsController < ApplicationController def list @products = Product.find(:all) end def show @products = Product.find(params[:id]) end def new @product = Product.new end def create @product = Product.new(params[:product]) if @product.save redirect_to :action => 'list' end end

Add new product

<% form_tag :action => 'create' do %>

: <%= text_field 'product', 'name' %>

: <%= text_field 'product', 'price' %>


<%= text_area 'product', 'description' %>

<%= submit_tag "Create" %> <% end %>