Usage Rails 3.0 beta 3 without ActiveRecoord ORM
Posted
by Anton
on Stack Overflow
See other posts from Stack Overflow
or by Anton
Published on 2010-06-14T11:28:15Z
Indexed on
2010/06/14
11:32 UTC
Read the original article
Hit count: 214
ruby-on-rails
|ruby
Hi everybody! Just installed Rails 3.0 beta 3 in Windows 7. And started playing with some easy examples
class SignupController < ApplicationController
def index
@user = User.new(params[:user])
if method.post? and @user.save
redirect_to :root
end
end
end
class User
def initialize(params = {})
@email = params[:email]
@passw = params[:passw]
end
def save
end
end
<div align="center">
<% form_for :user do |form| %>
<%= form.label :email %>
<%= form.text_field :email %><br />
<%= form.label :password %>
<%= form.text_field :password %><br />
<%= form.submit :Register! %>
<% end %>
</div>
When I go to /signup I'm getting this error
NoMethodError in SignupController#index
You have a nil object when you didn't expect it! You might have expected an instance of Array. The error occurred while evaluating nil.[]
Is there a problem with constructor or what's wrong?Please, need your help!
© Stack Overflow or respective owner