Jump to content

What is Ruby on Rails ? Any Idea


rajmohan
 Share

Recommended Posts

  • 2 weeks later...

ROR is a fairly robust scripting language featuring a 4GL framework. Ruby is the language Rails is the framework. Some Japanese bloke invented ruby as an alternative scripting language. Fairly easy to pick up, but at the moment not a lot of hosting companies with ROR options. If you google there's a number of ROR forums out there, and yes a number of free applications.

 

Fairly amazing things can be achieved with a minimum number of lines of code, there's a forum product available coded at under a 100 lines for example  :o

 

Played around with it a bit in order to write a few tutorials for another place, but prefer php as a learning exercise seems a lot more robust. There's a few security holes in ROR at present, though they may have fixed them by now.

 

ROR is of course a free product and is pretty much a no brainer to install. Not aware of any IDEs for it.

 

Hope that helps.

Link to comment
Share on other sites

Not aware of any IDEs for it.

 

There are several IDE's for ruby and RoR. I use NetBeans Ruby Ide, which is the best in my opinion. There is also RaidRails,RoRed(nice and light weight) and numerous others. I have  even been able to get dreamweaver 8 and CS3 to syntax highlight and auto suggest for Ruby and Rhtml. Now as far as security concerns.. There are no more then there are with php. It is all in how you code.. If you place $_POST or $_GET directly in a query without cleaning it, you can 't blame php for being insecure. RoR has many built in defenses for things like that but in the end the application is only going to be as secure as the developer codes it to be.

Link to comment
Share on other sites

Ruby and PHP can basically do the same.  I personally don't like the syntax on the ruby language itself but that is just me coming from a C++ background(and i am not a major fan of the java syntax which i think ruby is like).  I think as a standalone language, PHP is better than Ruby(i almost never here about how good ruby is only how good rails is).  I am sure if someone wanted to they could build a framework like rail for PHP(their are already some very nice Frameworks for PHP)

Link to comment
Share on other sites

Ruby is one of the most elegant languages I have ever seen. For expensive code you can wrap it in a begin block and ruby will process it separately. You also have instance variables which really make your life easy. Not only that but you can define dynamic methods for your objects. Here is a simple example that would loop through a directory and then define a method with the file name from the directory.

 

begin
   dir = "/path/to"
   Dir.foreach(dir) do |file|
      if FileTest.file?("#{dir}/#{file}")
         define_method "#{file.split(".").first}_remove" do
              if File.unlink("#{dir}/#{file}")
                 return true
              else
                 return false
              end
         end
      end
   end
end

#now say you have a file called remove_me you would call 
if remove_me_remove
   puts "The file was removed"
else
   puts "Unable to remove the file"
end

 

Not sure how useful that would be but it is a good example as to how you can really do some neat stuff with the language.

Link to comment
Share on other sites

that is an example of how i do not like syntax, for instance

 

Dir.foreach(dir) do |file|

 

that is just akword form what i have programmed for the past 10 years(almost like perl which is another language syntax i do not like).  why not have something like:

 

Dir.foreach(dir as file)

or

Dir.foreach(dir, file)

 

Those 2 are a lot cleaner then the ruby example.  also i rather have the {} than the end for block type statement, a lot cleaner in my opinion.

Link to comment
Share on other sites

Webhostfreaks.com offers Rails hosting and is owned by the same person that owns this site.

 

I think most people who are using RoR on sites have their own dedicated server and can put whatever they want on it.

 

You are correct and the reason is, most hosting companies use fastcgi as the hosting method for Rails and let me tell you... FastCgi with rails is anything but fast when compared to using mongrel and rails with an apache front end.

Link to comment
Share on other sites

This thread is more than a year old.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.