Basically whe we are novice to rails application, we used to place all our codes in our view pages and used to keep our model & controller files almost blank.
For a sample app our view, controller and model files used to look some way similar to this :
#view
Here we got :
1. All our codes in lonely view page.
2. Controller & model seems totally null.
But our code got following flaws :
1. No Readability
2. No Maintainability
3. No code separation concept
4. In total NO MVC.
Further we can improve this code with following changes:a
1. our view page containing only HTML contents.
2. Our Controller will get skinny (this should not be anything more than a connecting bridge between model & View)
3. Our Model will be boosted with all ruby codes.
4. Here we got :
i) All our codes in lonely view page.
ii) Controller & model seems totally null.
But our code got following flaws :
i)No Readability
ii) No Maintainability
iv)No code separation concept
v) In total NO MVC.
Further we can improve this code with following changes:a
1. our view page containing only HTML contents.
2. Our Controller will get skinny (this should not be anything more than a connecting bridge between model & View)
3. Our Model will be boosted with all ruby codes.