Mar 10
Next step : Creating the database for the filename application
The next phase or step would be to create a database for the application to use. Make sure the MySql engine is running and in the command window type “mysql -u root -p” and press enter and another enter for the password when prompted for there has not been any defined password yet. You are now logged into the engine as the root user and proceed to create the database by entering the following command “create database filename_development”. Also type in “grant all on filename_development.* to ‘ODBC’@'localhost’ this tells windows to grant access to a user named ODBC so you avoid an error when you try to access the said database from the command prompt. We next tackle the creation of tables that would allow the database to store the information we send it.
No commentsFeb 10
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.
No commentsJan 10
RoR Application Directories in-depth
There are quite a number of directories locate in the apps folder we have just created so to de-mystify them here are some explanations which hopefully would help you out. The directory “app/controllers” is where Rails searches for the controller classes which controls the web request from the user. The next one is the, “app/views” folder which houses the templates to which the data from the app is converted to HTML and then returned to the user’s browser. The next folder houses the “apps/models” subdirectory which contains the data classes that wraps the data stored within the application’s database (this is the messiest part of the framework in other frameworks). Then last of the vital sub-directories is the “app/helpers” which hold the helper classes of data that assists the view, model and controller classes keeping them small, organized and focused on the task it is supposed to do in the first place.
No commentsDec 1
Hashes (Part 2)
Top find out what each key in the hash is associated with :
salad['green salad'] => “lettuce and sweet basil”
As with arrays, there are a lot of useful methods in creating them.
salad.empty? (to check if the hash is empty)
salad.size (to check for the number of elements in the hash)
salad.keys (to get all the keys in the hash to create an array)
salad.values (to get the keys in the form of an array but not necessarily in the order they’ve been entered in the hash)
All the above operations are built-in methods that are used for such purposes.
No commentsNov 29
Hashes (Part 1)
Hashes are simply arrays that link one object to another object (think of it as an association of sorts), say like Spagthetti_sauce which is part of the complete menu, referring to the hash Spaghetti_sauce gives you the ingredients. Same as with arrays, they are created with the “.new” method resulting in an empty hash.
salad = Hash.new
Using curly braces, you get to assign the hash its elements like the example shown below:
salad = {
green salad => ‘lettuce and sweet basil’
coleslaw => ’shredded lettuce, garlic and onions, carrots’
garden fresh => ‘cherry tomatoes, lettuce, iceberg, iceberg lettuce, mayonnaise, olive oil, lemons
}
Oct 29
Regular Expressions and Blocks (Continued)
The caret “^” and the “&” operators are used for matching the beginning of a string, and also for the end of a string shown below:
matching =/[a-e]$/
The script would look for similar letters between “a” and “e” respectively including the end of the string. To search for a letter inside a string:
[A-Z] all uppercase letters
[a-z] all lowercase letters
[0-9] all digits(numbers)
To restrict the range, say to look for only the letters between “a” and “e”, you write it as [a-e] combined with the caret operator shown below:
[^A-Z] all other characters except uppercase letters
[^a-z] all other characters except lowercase letters
[^A-Za-z] no letters, whether upper or lower case
Sep 25
Regular Expression and Blocks
Ruby expressions would be shocking for the uninitiated or those who are shifting form other programming languages. If you have experience with Perl or Python, then you’re in luck for they won’t send you packing up and running in fear. The term “regular expression” is used to have a program check if it looks like something else in terms of similar characters or spacing, length or a myriad of other things that you may think of. The table form Ruby.org summarizes all the Ruby expressions and elements. Regular expressions are used for matching certain patterns such that if you’d want to check for a digit you use the \d expression or to match a space character, you use the \s expression to match a space character.
No commentsAug 10
Ruby on Rails Essentials
Because of its success, popularity and functionality, Ruby on Rails performs with an extensive variety of web servers and databases. Recommended for web servers would have to be Apache, lighttpd or nginx in place of Mongrel or it can be by means of FastCGI. Meanwhile, for database, the following have been suggested to be utilized: MySQL, PostgreSQL, SQLite, Oracle, SQL Server, DB2 and a lot more of servers that Ruby on Rails support and work well with. There is no limitation or strictly recommended on which operating system to use, but the best to make use of is a ‘nix-based one for deployment.
No commentsJul 11
Who Uses Ruby on Rails?
When it comes to infrastructure, Ruby on Rails is all over it. From start-ups to non-profits for venture projects of businesses, Rails can handle it. It is the best tool for almost whichever kind of web application (software collaboration, community, e-commerce, content management, statistics, management, etc). Shopify, Yellow Pages , Backpack, Github and Twitter are only some of web sites that uses Ruby on Rails. These web sites have trusted Ruby on Rails do manage their web applications that is made easy to use for people browsing, customers and people in need of the information provided by the web site.
No commentsJun 23
RIP – Shaking out RubyGems
Rip has quietly been making its way out into the world of Ruby, but the power it holds within is seen as the next generation packaging for Ruby Apps. The system that has come out is on the “development alpha” stage which can be compared to the release candidates by which developers can begin to experiment and build applications with. They however stressed that the version out of the box is still to be finalized and should not be used for production till they get it fully tested and debugged for pending release. Read more








