On 19 January 2012 20:42, art tav <[email protected]> wrote:
> Hi,
>
> I'm having an issue with some routes in my apps, the apps are the same
> app the only difference is that I use one for testing and the other for
> production stored in different directories lets say 'test' and 'prod'.
>
> The applications work with phusion passenger and their work in a virtual
> host.
>
> The thing is that in my routes.rb I have this code for both apps:
>
>  map.connect '', :controller => 'controllerName'
>
> It seems that all worked just fine until I tested a form and the
> resulting url was something like this: www.name.com/controllerName when
> the correct url must be something like this
> www.name.com/test/controllerName.
>
> The form that give me this problem is this one:
>
> form action="../controllerName/" method="post"
>
> form action="/controllerName/" method="post"

I hesitate to reply because I do not fully understand what you are
doing so anything I say may be rubbish.  However I believe that the
url generated by a commit action of a form (which I think is what you
are referring to) is nothing to do with anything in routes.rb, it is
purely determined by the html of the page and, if it is a relative
url, then the url of the current page.  The routes.rb file is only
referenced after the post is received to determine where to send it.
Secondly you say that the form giving the problem is "this one" then
show us two form tags.
Thirdly, and this is the bit I don't understand and so hope to learn
more, why are you specifying the controller name in the action and why
the ../ or / on the front?

Colin

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to