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.

Posted in Basics, Sample Code, Set-Up | Tagged , , , | Comments closed

Ruby on Rails: Basic

ruby_on_rails.jpgby: Djai Tanji

Ruby on Rails (Rails or RoR) is written in the Ruby programming language which is a dynamic, reflective, general purpose object-oriented programming language that merge syntax influenced by Perl with features like Smalltalk. It is designed to make web development faster, simpler and more efficient. It supports multiple programming paradigms like object oriented, functional and imperative. It is comparable in varying respects to Python, Perl, Dylan, Lisp and CLU because of its dynamic system and automatic memory management features. Ruby is a single-pass interpreted language in its current official implementation written in C and because there is no specification for the Ruby language, the implementation is measured to be a de facto reference.

Posted in Information | Tagged , | Comments closed

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.

Posted in Basics, Set-Up | Tagged , | Comments closed

Ruby On Rails Flexibility

As far as programming is concerned, compatibility and ease of use of the logic is what any programmer would certainly dream off. With the fast paced technology we live on today, more programming languages have made interface for people to understand how to get new means of programming logic to go by.

Rails works with a wide range of web servers and databases. For the web server, recommended are Apache, lighttpd, or nginx proxying to Mongrel (or using FastCGI). For database, use MySQL, PostgreSQL, SQLite, Oracle, SQL Server, DB2, or any of the other many systems supported can be considered as well.

Posted in Basics, Programming | Comments closed

Ruby Shortcuts Program Scripts Logically

As far as scripting is concerned, it would be less of a headache if programming scripts were used in the lesser means of coding. Too much scripts and line breaks in the usual scripting techniques of programming today makes it more complicated and harder to trace the root of the actual problem at hand.

What is important is that you are able to understand the basic commands and terms in Ruby. Once you do, you will surely find it convenient to use considering that debugging can prove to be a hassle if you are not aware of what you are doing today in the world of programming and scripting.

Posted in Basics, Programming | Comments closed

Using the IF Statement

If you are a programmer then most probably you know that when the IF statement is used, it stands for options as far as the program flow is concerned. It is not different in Ruby on Rails and other programming languages since normally, the need to provide users of the program with the variable options is a need.

Here is a sample of the IF statement in code:

class BookList
def [](key)
if key.kind_of?(integer)
result = @Books[key]
else
result = @Books.find { |aBooks| key == sBooks.name}
end
return result
end
end

Further shortening the code we have above by using the ‘if’ statement as a modifier it becomes a shorter version of its former self as:

class Booklist
def [](key)
return @Books[key] if key.kind_of?(Integer)
return @Books.find { |aBooks| aBooks.name == key }
end
end

(Source) Artueel Blog

Posted in Programming, Sample Code | Comments closed

Benefits of Using Ruby On Rails

For most business owners, it has been advised the Ruby on Rails is the best way to go especially if you don’t want too much technical terminology with reference to the programming included in the whole package.

Known to be an extension of the Ruby programming language, it is a very powerful and enriching programming language. It uses intelligent reflection and discovery to automatically map relational database tables to Ruby objects.

Thus, the application code and the running database already contain everything Rails needs to know. Best of all, it requires less coding, something that is the normal excuse each time a compiled program goes on the blink.

(Source) Script2Please

Posted in Basics, Programming | Comments closed

Ruby on Rails is Leading in Web Application Development

The obvious need today is to go with the flow of technology as aggressive web applications are being produced here and there. Ruby on Rails has been identified as the best interface software that programmers look forward to today since it simple yet great output makes the world of programming all the more simpler.

You can really install it on any software even on your Windows XP or Vista. With all the ideas of new developmental software up in the air, you can just imagine how many programs from people can be seen after some time especially once they have settled in and mastered this program.

Posted in Advanced, Basics, Programming | Comments closed

Ruby on Rail’s alternative implementation

ror_1.jpg

JRuby, YARV, Rubinius, and IronRuby are some of the alternative implementation of the Ruby language as of 2008 with each of them taking a diverge approach.

•JRuby – One of the strong features of JRuby is its capacity to invoke the classes of the Java Platform considering that it is a Java implementation of the Ruby and is closely incorporated with Java.
•YARV – an acronym for Yet Another Ruby VM, it is a bytecode interpreter developed for the Ruby programming language with the goal of trimming down the execution time of Ruby programs
•Rubinius – it is clean, understandable code that is easy for users to comprehend and extend. It is a virtual machine and compiler for Ruby.
•IronRuby – an approaching implementation of the Ruby programming language that targets Microsoft .Net framework

Posted in Basics | Tagged , , , | Comments closed

Convention Over Configuration

2439047093_63a0999615.jpg

One of the Ruby on Rails fundamental principle is “convention over configuration.” It aims to reduce the number of decisions that developers need to make as it gains simplicity but not losing flexibility. The simple phrase implies that a developer only needs to indicate alternative aspects of the application. When the convention implemented by the tool you are utilizing equals your desired behavior, you take pleasure in the gains not even having to write configuration files. When your desired behavior digresses from the implemented convention, then you configure your desired behavior. The programmer can work at a higher level of abstraction with all this configuration free approach to programming.

Posted in Basics | Tagged , | Comments closed