Forum: Ruby on Rails form_for and ActiveResource

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
997433f165140d58f52b8c0d1d005dc1?d=identicon&s=25 Patrick Aljord (Guest)
on 2007-06-29 02:40
(Received via mailing list)
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| %>
  <b>First name</b><br />
  <%= text_field :profile, :first_name %>
  <b>Last name</b><br />
  <%= text_field :profile,  :last_name %>

  <%= submit_tag "Create" %>
<% end %>

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

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 =>'',:last_name=>'')

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

Thanx in advance

This topic is locked and can not be replied to.