<%= form_for @user1 do |f| %>
Username: <%= f.text_field :username %> <br />
Password: <%= f.password_field :password %> <br />.
Email: <%= f.email_field :email %> <br />
<%= submit_tag "Add" %>
<% end %>
我是新的紅寶石,我想創建簡單的程序,但我有這個錯誤,我找不到原因。我有這個錯誤undefined方法`users_path'
undefined method `users_path' for #<#<Class:0x000000020576f0>:0x0000000335d5d8>
這裏有什麼解決方案?
class UserController < ApplicationController
def add
@user1 = User.new
respond_to do |format|
format.html
format.json {render :json => @user1}
end
end
什麼是@ USER1 - 如何它創建? – DGM 2012-04-19 13:10:21