Skip to content

DovetailSoftware/fubuvalidation

 
 

Repository files navigation

FubuValidation

What is FubuValidation?

FubuValidation is a member of the Fubu-family of frameworks -- frameworks that aim to get out of your way by providing rich semantic models with powerful convention-driven operations. It aims to provide a convention-driven approach to validation while supporting more traditional approaches when needed.

An important thing to note: FubuValidation is NOT coupled to FubuMVC. In fact, it maintains no references to the project.

What is FubuMVC.Validation?

FubuMVC.Validation is a package that adapts FubuValidation to the FubuMVC framework and provides out-of-to-the-box support for many common validation scenarios (both ajax and non-ajax).

Get it on NuGet

You can clone our repo and build from scratch, or you can use our NuGet packages:

  • FubuValidation - The core validation framework
  • FubuMVC.Validation - FubuMVC specific uses for FubuValidation

Using FubuMVC.Validation

By default, FubuMVC.Validation will be automatically be applied once it is installed. The default policy is to make any chains matching the following criteria validated:

  1. Any route that responds to an HTTP POST
  2. Any chain that returns an AjaxContinuation

Why does git status show that all of my files are modified?

The Fubu-family of frameworks are built by Windows users, so all of the text files have CRLF line endings. These line endings are stored as-is in git (which means we all have autocrlf turned off). If you have autocrlf enabled, when you retrieve files from git, it will modify all of your files. Your best bet is to turn off autocrlf, and re-create your clone of FubuMVC.

  1. Delete your local clone of the repository
  2. Type: git config --global core.autocrlf false
  3. Type: git config --system core.autocrlf false
  4. Clone the repository again

More information about working with git and FubuMVC

Where is CommonAssemblyInfo.cs?

CommonAssemblyInfo.cs is generated by the build. The build script requires Ruby with rake installed.

  1. Run InstallGems.bat to get the ruby dependencies (only needs to be run once per computer)
  2. open a command prompt to the root folder and type rake to execute rakefile.rb

If you do not have ruby:

  1. You need to manually create a src\CommonAssemblyInfo.cs file
  • type: echo // > src\CommonAssemblyInfo.cs
  1. open src\FubuValidation.sln with Visual Studio and Build the solution

Building FubuValidation

  1. If you do not have Ruby installed, get the latest version and install it. For Windows, you can find it at RubyInstaller
  2. After Ruby is installed, in the root directory, run InstallGems.bat
  3. If that succeeds, in the root directory, run rake
    1. If prompted, run git submodule update --init to populate your buildsupport folder.
    2. Rerun rake
  4. At this point, the project should have all NuGet packages pulled down, been built and tested.

You are now ready to launch FubuValidation.sln

About

FubuValidation -- have validation your way, whatever way that happens to be

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C# 74.6%
  • JavaScript 23.6%
  • Ruby 1.1%
  • Other 0.7%