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| %>
<%= text_field :profile, :first_name %>
<%= text_field :profile, :last_name %>
<%= submit_tag "Create" %><% end %>
And in my controller I have:
@profile = Profile.new
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:
@profile = Profile.new(:first_name=>’’,:last_name=>’’)
But it’s not really pretty.
Is there a better way to do so?
Thanx in advance