# form\_for and ActiveResource

**URL:** <https://discuss.rubyonrails.org/t/form-for-and-activeresource/15060>\
**Category:** rubyonrails-talk\
**Created:** [June 29, 2007, 12:39am UTC](https://discuss.rubyonrails.org/t/form-for-and-activeresource/15060 "2007-06-29T00:39:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Patrick\_Aljord](https://avatars.discourse-cdn.com/v4/letter/p/ce7236/32.png) [@Patrick\_Aljord](https://discuss.rubyonrails.org/u/Patrick_Aljord)\
**Post date:** [June 29, 2007, 12:39am UTC](https://discuss.rubyonrails.org/t/form-for-and-activeresource/15060/1 "2007-06-29T00:39:18Z")

</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| %\> \<p\> &nbsp;&nbsp;\<b\>First name\</b\>\<br /\> &nbsp;&nbsp;\<%= text\_field :profile, :first\_name %\> \</p\> \<p\> &nbsp;&nbsp;\<b\>Last name\</b\>\<br /\> &nbsp;&nbsp;\<%= text\_field :profile, :last\_name %\> \</p\>

\<p\> &nbsp;&nbsp;\<%= submit\_tag "Create" %\> \</p\> \<% end %\>

And in my controller I have: def new &nbsp;&nbsp;@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 &nbsp;&nbsp;@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
