# Canonical way to do a create form for ActiveResource?

**URL:** <https://www.ruby-forum.com/t/canonical-way-to-do-a-create-form-for-activeresource/92953>\
**Category:** Rails\
**Created:** [April 26, 2007, 12:50am UTC](https://www.ruby-forum.com/t/canonical-way-to-do-a-create-form-for-activeresource/92953 "2007-04-26T00:50:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bluetrust](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/8e7dd6/32.png) [@bluetrust](https://www.ruby-forum.com/u/bluetrust)\
**Post date:** [April 26, 2007, 12:50am UTC](https://www.ruby-forum.com/t/canonical-way-to-do-a-create-form-for-activeresource/92953/1 "2007-04-26T00:50:39Z")

</div>

What would be the proper way to do setup a create action for an  
ActiveResource?

I can’t just use @object = MyResource.new in the new action, because  
the bare resource doesn’t have any attributes, so in the form  
@object.name etc. will fail.

I can use an OpenStruct, but then other things fail, like  
error\_messages\_for

I would like if possible for the view to not have to care at all  
whether it is being used to edit an ActiveResource or an ActiveRecord.

Thanks,  
Michael J.
