Form_for and ActiveResource

Hey all,
I have a “Profile” model that I get with ActiveResource.
I have a basic form in my application to create Profiles like this:

<% form_for(:profile, :url => profiles_path) do |f| %>

First name
<%= text_field :profile, :first_name %>

Last name
<%= text_field :profile, :last_name %>

<%= submit_tag "Create" %>

<% end %>

And in my controller I have:
def new
@profile = Profile.new
end

When I visit /profile/new, I get this error:
undefined method `first_name’ for #Profile:0xb698fa24

It works though if I change the “new” function this way:
def new
@profile = Profile.new(:first_name=>’’,:last_name=>’’)
end

But it’s not really pretty.
Is there a better way to do so?

Thanx in advance

Pat

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs