Image Source: www.anylinuxwork.com
Here are some few command line options in which can guide you in programming your Ruby on Rails:
-0[octal}
The number “0” flag specifies the record separator character (\0, if no digit follows). -00 indicates paragraph mode: records are separated by two successive default record separator characters. -0777 reads the entire file at once (as [...]
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 [...]
Also posted in Programming |
The previous post using the yield statement gives us the following output which shows the ease of using blocks in programs which can be used to pass on parameters to the other parts of the same statement.
The code from the previous post gives the output:
Hi There
Hi There
Hi There
The code between the curly braces is associated [...]
Also posted in Basics | Tagged parameter passing, yield |
It might be almost similar but relatively different in a big way for blocks may appear only in the source adjacent to a method call which means it should be written on the same line as the method’s last parameter and it is not implemented once it is encountered but, Ruby rather remembers the context [...]
Also posted in Basics | Tagged simplifying code, yield |
As said in the past post, there is an easier way of doing the stuff we did in the last program which would be very helpful when coding thousands of line of code when you do end up building your own programs is ruby.
class BookList
def [](key)
if key.kind_of?(integer)
[...]
The process shown below is and example of using the [] to have the program execute a condition that searches the contents of an array till a match is found. It goes from the top to the bottom to check each and every member of the array to look for a match doing the requested [...]
Save the text file with the following filename “first1.rb” and we now go into the syntax checking function and the facility provided to show the syntax check verbosely. The following code shows how code is checked for syntax correctness and returns the result of the said checking by typing the following code :
$ ruby :cw [...]
RubyonRails is similar to most programming languages where in one can use the command line in windows or a terminal in Unix based systems. All programs should be written and saves in plain text format for the compiler and interpreter to process it easily. The first program would give you a feel for the overall [...]
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 [...]