Take the 2-minute tour ×

I have recently created a new rails 3 application, using the code that I wrote for Rails 2, upgrading it at the same time to match the new API.

I have the following code:

FtpMgmt::Application.routes.draw do
    resources :accounts
    root :to => "accounts#index"

<% form_for(@account) do |f| %>
<% end %>

class AccountsController < ApplicationController
    respond_to :html, :xml, :json
    def new
        @account = Accounts.new

The error I get is:

Showing /opt/rails/ftp_mgmt/app/views/accounts/new.html.erb where line #3 raised: 
undefined method `accounts_index_path' for #<#<Class:0x0000000a28a758>:0x0000000a269b70>

Do you have any ideas how I can fix this?

share|improve this question

1 Answer 1

up vote 1 down vote accepted
@account = Accounts.new

should be

@account = Account.new



should be

<%= form_for(@account) do |f| %>
share|improve this answer

Your Answer


