Note that there are some explanatory texts on larger screens.

plurals
  1. POsupressing link_to default action in rails3
    primarykey
    data
    text
    <p>I read on this part of the ruby guide: <a href="http://guides.rubyonrails.org/routing.html" rel="nofollow">http://guides.rubyonrails.org/routing.html</a></p> <p>that it is not always ideal to cram things into CRUD. I have a case for this, I want to have a final "submit" button after a survey that goes through and re validates that all data has indeed been filled out (since you can work on the survey in parts and it will save and validate to the database) but for final submission EVERYTHING has to be filled out. So my submit link_to I would like to call a method in the controller:</p> <p>in my view:</p> <pre><code>&lt;%= link_to "Submit", :action =&gt; 'final_verify', :document_id =&gt; @document.id %&gt; </code></pre> <p>now I am using wicked as a wizard controller, sO i had to create a route to match so this call would work:</p> <p>routes.rb:</p> <pre><code> #match route so I can call from page_controller.rb match ':controller/:action/:id' </code></pre> <p>So this works, it runs etc, but the issue is then if there is an error in the final_verify I want to redirect to a specific page, do I create a route for this? or do I have to just finagle the redirect_to to do this properly? I cannot seem to figure out the best/correct way to do this?</p> <p>I am not convinced my matched route is even the right way to go just to get the link_to to call that final verify and goto the offending page (if any) so users can complete required parts and try submitting again. (Partially whats tripping me up is how to do this using the wicked gem <a href="https://github.com/schneems/wicked" rel="nofollow">https://github.com/schneems/wicked</a></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload