ruby on rails - Overriding a resource route to / (root) in Rails3: not changing the path helper? -


I am quite new to Rail 3, I basically made a consumer muddy , I only want my app to answer the new and create functions.

Therefore, I have been defined in config / routes.rb :

Resources: Consumer ,: Only => [: New, Create] < / Pre>

that works like this

Received / Consumer => Subscriber # New Posts / Members => Customer #create

Now I will assign my app to / instead of (root) I want to display the resources of customers on / subscriber , so I did this:

 match '/' = > "Subscriber #New" match '/' => "Subscriber "Match" / '=>' member # thanks' to create Iber # Resource: Customer, only => [: 

  1. Works in any way, but maybe not the slowest thing Here are the issues I have: Here

    1. On returning to the form after an issue, instead of creating a browser, the / Subscriber URL displays instead of just As / , the form is created using the form_for (@subscriber) helper method, hence the path The subsidiary should be unaffected by the root in some way
    2. Officially I do not even want to answer a request on / Subscriber
    3. The strange bug, while disconnected, while I was posting the form ( / ), and then the connection comes back when one is refreshing (ask to re-submit the browser => OK), Rail app crash (I do not have an error stack Although it was on production), why is it so? Apart from this, I tried to establish this path:

       Resources: Customer, only:> =: [: new, create] 'Archive' post Do / '=>: Make' / '=>: New End End 

      Which is probably DRYer, but it does not fix any of these problems.

      I'm sure this is something very easy, please help!

Thank you for your reply, this help me the exact solution to my question:

 Resources: Customer, only => [: new, create]: path => '',: path_names => {: new => ''} 

Work on testing and rail 3: )


Comments