Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You do not really need any guidance from examples on how to do this. Ultimately you will have to be able to create such applications on your own which means being creative.</p> <p>I've decided from the beginning do not use either built-in validation or membership API in order not to run into its limitations at some point of time.</p> <p>For your situation: it's pretty much standard.</p> <p>Imagine the execution flow as follows:</p> <ol> <li>Post form</li> <li>Validate input data format without talking to the database</li> <li>If (2) is pass, then you validate the input from the point of business rules/data integrity. Here you talk to the database</li> <li>If (3) passed then perform your operation whatever it is. If it somehow fails (maybe data integrity rules in the database prohibit the operation, say, you deleted a related object from the other browser window) then cancel it and notify the user of an operation error.</li> </ol> <p>Try to keep controller methods as empty as possible. The validation and operation logic should reside in your models and business logic. The controller should basically attempt the one intended operation and based on the status returned just return one view or the other. Maybe a few more options, but not the whole load of checks for user roles, access rights, calling some web services etc. Keep it simple.</p> <p>P.S. I sometimes get the impression that the built-in features intended to simplify simple things for majority of developers tend to create new barriers over the removed ones.</p>
    singulars
    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