Here's what my parts_controller's create method looks like:

  # POST /parts
  # POST /parts.xml
  def create
    # Record current user's id as he/she created the part
    params[:part][:created_by] = current_user.id
    params[:part][:updated_by] = current_user.id

    @part = Part.new(params[:part])

    if @part.save
        flash[:notice] = 'Part was successfully created.'
        redirect_to( :action => 'index' )
    else
        format.html { render :action => "new" }
    end
  end

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to