polymorphic singleton controller update form path

3 views
Skip to first unread message

Peter Berkenbosch

unread,
Aug 12, 2009, 4:56:27 AM8/12/09
to resources_controller
Hello List,

I have an issue with a polymorphic singleton controller.

The form_for tag is like this:
form_for [parent_object,object] do |form|

But this is generating a wrong path.
<form action="/accounts/1/company.%23%3Ccompany:0x22228f4%3E"

This should be /accounts/1/company

How do I get het correct post url ?

The controller (CompaniesController )

resource_controller :singleton
belongs_to :account

Thanks...

With regards,

Peter Berkenbosch

Jason Lee

unread,
Aug 12, 2009, 7:48:50 AM8/12/09
to resources_controller
Hi Peter,

have you tried using the super-excellent resources_controller
form_for_resource helper?

e.g. <% form_for_resource do |f| %>

api documentation here:
http://plugins.ardes.com/doc/resources_controller/classes/Ardes/ResourcesController/Helper.html#M000052


Jason.



On Aug 12, 9:56 am, Peter Berkenbosch <peter.berkenbo...@gmail.com>
wrote:

Peter Berkenbosch

unread,
Aug 12, 2009, 4:41:08 PM8/12/09
to resources_...@googlegroups.com
Hi Jason,

Thank you very much for you anwser. It seems that i'm posting this in the wrong user group. Since I use resource_controller and not resources_controller

So I will need to investigate this further somewhere else.

With regards.

Peter Berkenbosch. 
--
met vriendelijke groet,

Peter Berkenbosch
Reply all
Reply to author
Forward
0 new messages