Hello,
I''m experimenting with ActiveResouce and created a very simple server
and client application with a single Person resource.
I am getting the following error when trying to use the new person
form:
undefined method ''first_name'' for #<Person:0x215dacc>
The same form works fine on the server application using the
ActiveRecord.
Here is my AR model:
class Person < ActiveResource::Base
self.site = "http://localhost:3000/"
end
And my view:
<h1>New person</h1>
<% form_for(@person) do |f| %>
<%= f.error_messages %>
<p>
<%= f.label :first_name %><br />
<%= f.text_field :first_name %>
</p>
<p>
<%= f.label :last_name %><br />
<%= f.text_field :last_name %>
</p>
<p>
<%= f.submit "Create" %>
</p>
<% end %>
<%= link_to ''Back'', people_path %>
The odd thing is that I can create new Person objects from script/
console.
p = Person.new(:first_name => "Robert", :last_name =>
"Walker")
--~--~---------~--~----~------------~-------~--~----~
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
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---