On 19 January 2012 23:01, art tav <[email protected]> wrote:
>> 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?
>
> The ../ or / at the beginning are used for being certain that the url
> it's created from the root of the application, I found that when using
> html form tags in rails you need to add this to point to the right
> direction but apparently it's only needed when the controller is a
> different from the default controller.
>
> When you use that syntax directing the commit to the default controller
> you get the problem i'm having...
>
> So the solution is to write the form in this way if you try to reach an
> action inside the default controller.
>
> <from action="controllerName/action" method...>
>
> For any other controller this is correct
>
> <form action="/controllerName/action" method...>
>
> or
>
> <form action="../controllerName/action" method...>
>
> Also the controller name is need or you will get something like this
> www.name.com/action
> and unless you are aiming to a action in the default controller you will
> get an error there or in my case if you have multiple RoR applications
> in the same server.

OK, I have just realised (stupidly) that you are not using the rails
form helpers (form_tag or form_for).
When you say that it goes to the wrong url do you mean that POST goes
to the wrong url or after doing the POST action it then goes to the
wrong url.
Are you able to show me the html generated by the form tag (view the
page source in the browser and copy and paste the relevant html code
here.  Also look in the rails log (log/development.log) and copy and
paste the relevant section for clicking the submit button.

Colin

>
> I hope I made myself clear and didn't confuse you
>
> --
> Posted via http://www.ruby-forum.com/.
>
> --
> 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.
>



-- 
gplus.to/clanlaw

-- 
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