Follow the Coding Conventions
Rails follows a simple set of coding style conventions.
- Two spaces, no tabs (for indentation).
- No trailing whitespace. Blank lines should not have any spaces.
- Indent after private/protected.
- Prefer &&/|| over and/or.
- Prefer class << self over self.method for class methods.
- Use MyClass.my_method(my_arg) not my_method( my_arg ) or my_method my_arg.
- Use a = b and not a=b.
- Follow the conventions in the source you see used already.
- The above are guidelines — please use your best judgment in using them.
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.