Results 1 to 5 of 5
Thread: Basic tenets of Ruby on Rails
-
06-02-2011, 04:55 AM #1
MTV Regular
is Enjoying posting!!!I am:----
- Join Date
- Jun 2011
- Posts
- 375
- MTV$
- -8
Basic tenets of Ruby on Rails
Convention over Configuration
Rails has sensible defaults for every aspect of a web application. Following the conventions, you can write a Rails application, using less code than most other web application frameworks. If you need to override the conventions, it's also easy with Rails.
Don't Repeat Yourself (DRY)
Every piece of knowledge in a system should be expressed in just one place. From a coding perspective, the means you should not find yourself writing the same lines of functionality in multiple locations within the same application, including in more than one view template. Logic that is repeated should be consolidated into one location.
Fat Model, Skinny Controller
Most of your application logic should be contained in your models, rather than your controllers. Similarly, views should have a minimum of ruby code and more involved logic, such as complex formatting, should be extracted to helpers.
REST interface
REST is a commonly-utilized pattern for web applications - organizing your application around resources and standard HTTP verbs is the fastest way to go. Ruby on Rails provides extensive support for REST patterns by default, making it often the easiest design pattern to employ when using the Rails framework. If you are developing an application and finding that you have to manually create many of the routes and methods for a particular class, it may be worth examining if there is a more RESTful way to implement it. Using scaffolds and Rails metaprogramming (e.g. routing) will also generally encourage REST pattern use.
Write Good Tests
Rails comes with an integrated testing framework out of the box that supports common testing methods including unit and integration testing as well as fixtures. Having reliable tests will help a programmer tremendously when integrating new features or refactoring code – if you have appropriate testing coverage, you can immediately detect if a new change has broken any existing functionality.
Automate tasks
Your Rails project comes with many scripts and generators, which allow you to solve many common tasks in one line in the console. You can start the server, migrate the database, run tests, measure performance and much more with the help of Rake tasks and scripts
-
06-02-2011 04:55 AM # ADSAdvertise here Circuit advertisement
- Join Date
- My Birthday
- Posts
- Million and counting
-
09-09-2012, 06:25 PM #2
Banned
is who wander are lost!!!I am:
- Join Date
- Sep 2012
- Posts
- 1,704
- MTV$
- 5,031
Re: Basic tenets of Ruby on Rails
Automate tasks
Your Rails project comes with many scripts and generators, which allow you to solve many common tasks in one line in the console. You can start the server, migrate the database, run tests, measure performance and much more with the help of Rake tasks and scripts
-
09-14-2012, 12:26 AM #3
Banned
This user has no status.I am:----
- Join Date
- Sep 2012
- Posts
- 1,129
- MTV$
- 3,336
Re: Basic tenets of Ruby on Rails
REST is a commonly-utilized pattern for web applications - organizing your application around resources and standard HTTP verbs is the fastest way to go. Ruby on Rails provides extensive support for REST patterns by default, making it often the easiest design pattern to employ when using the Rails framework. If you are developing an application and finding that you have to manually create many of the routes and methods for a particular class, it may be worth examining if there is a more RESTful way to implement it. Using scaffolds and Rails metaprogramming (e.g. routing) will also generally encourage REST pattern use.
-
10-04-2012, 11:06 AM #4
Banned
is is banned for copy pastingI am:----
- Join Date
- Oct 2012
- Posts
- 340
- MTV$
- 1,000
Re: Basic tenets of Ruby on Rails
Ruby on Rails, often shortened to Rails, is an open source full-stack web application framework for the Ruby programming language. Ruby on Rails is not to be confused with Ruby, which is a general-purpose programming language, on which Ruby on Rails runs. Ruby itself existed for more than 10 years before the first release of Ruby on Rails. Rails is a full-stack framework, meaning that it gives the web developer the ability to gather information from the web server, talk to or query the database, and render templates out of the box. As a result, Rails features a routing system that is independent of the web server.
-
10-10-2012, 10:17 PM #5
MTV Regular
This user has no status.I am:
- Join Date
- Sep 2012
- Posts
- 493
- MTV$
- -37
Re: Basic tenets of Ruby on Rails
REST is a commonly-utilized pattern for web applications - organizing your application around resources and standard HTTP verbs is the fastest way to go. Ruby on Rails provides extensive support for REST patterns by default, making it often the easiest design pattern to employ when using the Rails framework. If you are developing an application and finding that you have to manually create many of the routes and methods for a particular class, it may be worth examining if there is a more RESTful way to implement it. Using scaffolds and Rails metaprogramming (e.g. routing) will also generally encourage REST pattern use.
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)































Reply With Quote



Bookmarks