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
: <%= text_field 'product', 'name' %>
: <%= text_field 'product', 'price' %>
<%= text_area 'product', 'description' %>