Archive for the 'Medium' Category
Database manipulation
The database has been initialized, so now we get down to business of defining the fields in that database and include a field that we would call a foreign key which allows the establishment of the one to many relationship between the tables. This part of the process requires quite a bit of background of database creation, manipulation and handling. It also requires knowledge regarding the workings of data types. So assuming you do not have much knowledge in such areas do some more reading to give you a better understanding of what how and why they are there. The ROR developers might say that it is very easy to do and use ROR but without the background on logic formulation, data types and manipulation as well as database handling the rest of the posts which would tackle ever hardening topics and operations would be very difficult to make sense of.
Don’t get me wrong, we just want to make life easier for you and not have you not understanding anything at all.
Comments are off for this postRuby on Rails Development Tips

Image Source: www.web2.socialcomputingmagazine.com
Ruby on Rails is great for acquiring ideas prototyped super quick. These tips will slow down growth and make apps less portable, but definitely progress the speed your system
Ruby on rails coding style:
• Try to evade the over indulgence use of helpers since it adds overhead.
• You may think about using memcached to cache your model and library computation results.
• Use a custom configuration file for passwords and API keys instead of keeping them in your Subversion repository. Use YAML and mirror the style of database.yml.
• Use constants when desired. Instead of repeating strings like the address of your customer service reply email, set it once in a constant (in environment.rb or the appropriate environment file) and use that throughout your application.
• Keep time in UTC. A no brainer, and easy to do.
• Don’t loop through ActiveRecord models inside other models. Use keen loading if you need to exertion with multiple associated models. Better yet, write a custom SQL query and let the database do the work for you.
Before You Start
Assuming you have even just a little background in programming with any language there are four basic programs and extensions that you need but are provided by the quick installers you’ve just downloaded to your hard drive. You have The Ruby programming language program files, the Rails part of the programming extension/platform, MySql or your database query handling system and the Apache which is a web server that you use to emulate your application’s execution on the web. Granting you have these set up properly and tested (instructions for which are included in the installer package). You can now start building your first application with RoR.
Comments are off for this post

