I was thinking about the same thing too, but something was blocking me at
that moment. Do you mind digging into the source code and see if it's
possible from your perspective, and then send a pull request if you can
patch it?

Thanks a lot! :)

On Wed, Jul 13, 2011 at 3:20 AM, Corin Langosch
<corin.lango...@netskin.com>wrote:

> **
> What about making the polymorphic routing in rails to try a plural route
> first. If it fails, try a singleton route. If it fails, raise.
>
> This is not the nicest and most performant way (the result could be cached
> in production so it doesn't really matter in the end) but I guess it should
> solve most cases. Or is this too much magic?
>
> Corin
>
>
> On 13.07.2011 00:17, Prem Sichanugrist wrote:
>
> There have been a lot discussion about this a while ago. However, we
> couldn't find the way to determine the correct route to use when you have a
> singular resource, so it was left unfixable.
>
>  The solution you'll have to do is to use `:url`
>
>  form_for @alpha, :url => alpha_path
>
> On Tue, Jul 12, 2011 at 4:23 PM, elfo <michaelelfa...@gmail.com> wrote:
>
>> There seems to be a small bug with has_one relationships and resource
>> in the routes.
>> Example:
>>
>> where beta has_one alpha
>>
>> In routes:
>> resource alpha
>>
>> In view:
>>
>> form_for @alpha --> automatic link is alpah_path(id) and not
>> alpha_path
>> and in this case since there is no id in the route, the id takes the
>> place of the format param -> /alpha.1
>>
>> Thanks!
>> Mike
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Ruby on Rails: Core" group.
>> To post to this group, send email to rubyonrails-core@googlegroups.com.
>> To unsubscribe from this group, send email to
>> rubyonrails-core+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/rubyonrails-core?hl=en.
>>
>>
>  --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Core" group.
> To post to this group, send email to rubyonrails-core@googlegroups.com.
> To unsubscribe from this group, send email to
> rubyonrails-core+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/rubyonrails-core?hl=en.
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Core" group.
> To post to this group, send email to rubyonrails-core@googlegroups.com.
> To unsubscribe from this group, send email to
> rubyonrails-core+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/rubyonrails-core?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To post to this group, send email to rubyonrails-core@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-core+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-core?hl=en.

Reply via email to