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")