Castle.MonoRail.ActiveRecordScaffold
Base abstract class for actions that relate to
Scaffolding support. Provide the basic flow process
Holds the AR type
Reference to the template engine instance
A map of PropertyInfo to validation failures
A list of errors that happened during this process
Constructs the data source for the binder
Binder that 'knows' ActiveRecord types
The model for the AR type we're dealing with
Used to define if the model name should be present on the action name (urls)
Indicates that the controller has no layout, so we use ours
Initializes a new instance of the class.
Type of the model.
The template engine.
Indicates that we should use the model name on urls
Whether we should use our layout.
Executes the basic flow which is
- Resolve the
- Resolve the layout (if not is associated with the controller, defaults to "scaffold")
- Invokes which should perform the correct process for this action
- Resolves the template name that the developer might provide by using
- If the template exists, renders it. Otherwise invokes
Implementors should return the template name
for the current action.
Only invoked if the programmer havent provided
a custom template for the current action. Implementors
should create a basic html to present.
Implementors should perform the action for the
scaffolding, like new or create.
Gets the property that represents the Primary key
for the current
Gets a value indicating whether the name of the model should
be used on the url.
true if yes, otherwise false.
Gets the current
Displays a confirmation message before performing
the removal of the instance
Searchs for a template named confirm{name}remove
Performs the inclusion
Searchs for a template named create{name}
Renders an edit form
Searchs for a template named edit{name}
Renders a list of entities
Searchs for a template named list{name}
Called when the template was not found
Renders an inclusion form
Searchs for a template named new{name}
Removes the ActiveRecord instance
Searchs for a template named {name}removed
Uses the dynamic action infrastructure to
add new actions to an existing controller.
Provided that a controller uses
like the following code:
[Scaffolding( typeof(Account) )]
public class AdminController : Controller
{
}
Then the following dynamic actions will be added:
- newAccount
Presents a form to the user fill in order to create the item on the database
- createAccount
Takes the information submited by the newAccount and creates the item
- editAccount
Presents a form to the user fill in order to update the item on the database
- updateAccount
Takes the information submited by the editAccount and changes the item
- listAccount
Presents a paginated list of items saved
- confirmAccount
Asks the user if he/she confirms the removal of the item
- removeAccount
Attempt to remove the item and presents the results
Performs the update
Searchs for a template named create{name}