Hi Paul,

I have looked at your code and reproduced your error. Unfortunately,
this doesn't have an easy solution:

"auto_actions_for" is used to generate automatic actions, routes, and
forms. What it does is look at the "Asset" model, look at the belongs_to
relationship, find the "Response" model and build from there.

When using a polymorphic belongs to relationship, this functionality
won't work, because it's not capable of finding the "Response" model.
I'm sure we could add some logic to find out which model you are
referring to, but I think it's a bit too complicated.

For your polymorphic case, I would suggest removing "auto_actions_for"
and adding the actions/routes/forms manually. Alternatively, you can
drop the polymorphic relationship and go for a simpler belongs_to. You
could even have several "belongs_to" relationships pointing to different
models, as a king of "polymorphic" hack.

Warm regards,
Ignacio

El 12-03-2015 a las 09:50, [email protected] escribió:
> I forgot to post the links:
> 
> Error Message
> 
>      http://pastie.org/10020364
> 
> Model definitions
> 
>      Asset:  http://pastie.org/10020370
>      Response: http://pastie.org/10020377
> 
> Assets controller
> 
>      http://pastie.org/10020379
> 
> 
> On Thursday, March 12, 2015 at 3:49:49 PM UTC+7, [email protected] wrote:
> 
>     In my app, I would like to easily add assets (which are attached
>     files) to responses, among other things. I have set up a polymorphic
>     relation between the classes, including the :inverse_of helpers.
> 
>     I added the auto_actions_for response to my assets controller.
> 
>     My first-order problem is that passenger will not start. The error
>     message is linked below, along with the two models and the assets
>     controller.
> 
>     Passenger starts fine when I comment out the auto_actions_for line.
> 
>     Any ideas? Thanks!
> 
> 
> On Thursday, March 12, 2015 at 3:49:49 PM UTC+7, [email protected] wrote:
> 
>     In my app, I would like to easily add assets (which are attached
>     files) to responses, among other things. I have set up a polymorphic
>     relation between the classes, including the :inverse_of helpers.
> 
>     I added the auto_actions_for response to my assets controller.
> 
>     My first-order problem is that passenger will not start. The error
>     message is linked below, along with the two models and the assets
>     controller.
> 
>     Passenger starts fine when I comment out the auto_actions_for line.
> 
>     Any ideas? Thanks!
> 
> 
> On Thursday, March 12, 2015 at 3:49:49 PM UTC+7, [email protected] wrote:
> 
>     In my app, I would like to easily add assets (which are attached
>     files) to responses, among other things. I have set up a polymorphic
>     relation between the classes, including the :inverse_of helpers.
> 
>     I added the auto_actions_for response to my assets controller.
> 
>     My first-order problem is that passenger will not start. The error
>     message is linked below, along with the two models and the assets
>     controller.
> 
>     Passenger starts fine when I comment out the auto_actions_for line.
> 
>     Any ideas? Thanks!
> 
> 
> On Thursday, March 12, 2015 at 3:49:49 PM UTC+7, [email protected] wrote:
> 
>     In my app, I would like to easily add assets (which are attached
>     files) to responses, among other things. I have set up a polymorphic
>     relation between the classes, including the :inverse_of helpers.
> 
>     I added the auto_actions_for response to my assets controller.
> 
>     My first-order problem is that passenger will not start. The error
>     message is linked below, along with the two models and the assets
>     controller.
> 
>     Passenger starts fine when I comment out the auto_actions_for line.
> 
>     Any ideas? Thanks!
> 
> -- 
> You received this message because you are subscribed to the Google
> Groups "Hobo Users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to [email protected]
> <mailto:[email protected]>.
> To post to this group, send email to [email protected]
> <mailto:[email protected]>.
> Visit this group at http://groups.google.com/group/hobousers.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups "Hobo 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/hobousers.
For more options, visit https://groups.google.com/d/optout.

Reply via email to