Validations:
Validations can be either done in the front end using javascript or at the back end before putting the data in the server.Which is better??
If all validations are done in the javascript "Disable javascript option can remove the vaildations.But if all the validations are done by the server there will be overhead in the server.So a balance between the 2 should be accomplished.
Various options that are available are
:acceptance--->If it has to accept to the terms and agreement etc.
:uniqueness
:singularity
:associated--->If some association is defined and you want automatic validations among the various associations.
:confirm--->eg)confirm password.For example the db will not have 2 fields separately for confirm field but unless this checking is done the db insert or update wont be done.Automatically the confirmation field will be created using "fieldname_confirmation"
:confirm and :acceptance generally doesnt store anything in the database,But can be made to do so.
Exclosion:Accepting values that it wont accept.
Inclusion:Specifying within what it will accept.
:format--->LIke checking the formats for email and stuff.
NILL AND BLANK:
a=nil
a.nil=true and a.blank=true
a=[]
a.nil=false
a.blank=true
You can also use "if" or "unless" along with validates..
Git:
This is a distributed revision control and version control with an emphasis on speed.If you have heard of subversion this is different from that.In subversion there is a central server from which you get your project make changes and again push it back into it.But git is distributed,and we can download a local copy into our system and make changes this change is applied only into the local copy.Only when you push it it goes into the main copy so that other users can pull it again.While working we can go pull the copy,make it merge and check with the merge conflicts and rectify it and then push it back.
Uses function like "clone" to make a local copy.Even im not sure of this but it is easy if we start working with it i guess.
Slim:
This is the simplified form of haml with no strict indentation issue.Read on to understand that.Haml is nothing but HTML substitute for erb.Problem with Html:DRY-repeating yourself.
Solution:
HAML
Open and close tags are avoided in this.
<p id="qq">
Hello
</p>
becomes either
%p#qq
Hello
or
%p{id=>"qq"}
Hello
Indentation matters in HAML.Two space or a tab represents nested loops.The second method is better among the above because when the attribute "qq" has to change with runtime returning hashes are better.
->THis reduces code size and doesnt repeat unnecessarily.
->Each code in HAML is converted to HTML,so there is a very little time lag.
-->There are gems lik HAMLtohtml and vice versa to convert between them
SAAS:
This is simpler form of HAML.But this allows inheritance in the classes of the css scripts.
