# Form\_for and ActiveResource

**URL:** <https://www.ruby-forum.com/t/form-for-and-activeresource/108109>\
**Category:** Rails\
**Created:** [June 29, 2007, 2:40am UTC](https://www.ruby-forum.com/t/form-for-and-activeresource/108109 "2007-06-29T02:40:09Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![patcito](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/50afbb/32.png) [@patcito](https://www.ruby-forum.com/u/patcito)\
**Post date:** [June 29, 2007, 2:40am UTC](https://www.ruby-forum.com/t/form-for-and-activeresource/108109/1 "2007-06-29T02:40:09Z")

</div>

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
