Support Forums
Ruby on rails - Printable Version

+- Support Forums (https://www.supportforums.net)
+-- Forum: Categories (https://www.supportforums.net/forumdisplay.php?fid=87)
+--- Forum: Coding Support Forums (https://www.supportforums.net/forumdisplay.php?fid=18)
+---- Forum: Ruby and Ruby on Rails (https://www.supportforums.net/forumdisplay.php?fid=55)
+---- Thread: Ruby on rails (/showthread.php?tid=14785)



Ruby on rails - Poppins - 12-20-2010

So many threads about ruby but not many about rails? I've been learning it since about 10 this morning (its 9pm) and I already love it =]

As apposed to PHP.

Code:
posts = Posts.where(:name => 'Hi')

posts.each do |post|
  puts post.name
end

That would probably take 4x as many lines to write in PHP.


RE: Ruby on rails - Orgy - 12-21-2010

4x? Lets see.

while ($row = mysql_fetch_array(mysql_query("SELECT * FROM posts WHERE name='hi'"))) { echo $row['name'] . "\n"; }

How about .25x

Suck it


RE: Ruby on rails - Swift Swim - 12-21-2010

(12-21-2010, 08:00 PM)Orgy Wrote: 4x? Lets see.

while ($row = mysql_fetch_array(mysql_query("SELECT * FROM posts WHERE name='hi'"))) { echo $row['post'] . "\n"; }

How about .25x

Suck it

Honestly, your reply made me laugh. If I could rep you I would.


RE: Ruby on rails - Beautiful - 12-21-2010

(12-21-2010, 08:03 PM)SehCure Wrote: Honestly, your reply made me laugh. If I could rep you I would.
Can't you rep?


RE: Ruby on rails - Solidus - 12-21-2010

PHP and RoR shouldn't be compared.
RoR and SQL just don't work together. PHP is much more useful imo, very efficient.


RE: Ruby on rails - Uknown_Hacker - 12-21-2010

Nah you need 100 posts.


I have never heard of This language untill now.
Seems strange.


RE: Ruby on rails - Poppins - 12-22-2010

(12-21-2010, 08:00 PM)Orgy Wrote: 4x? Lets see.

while ($row = mysql_fetch_array(mysql_query("SELECT * FROM posts WHERE name='hi'"))) { echo $row['post'] . "\n"; }

How about .25x

Suck it

Was about to reply and speak about the fact that you just put it all on one line =s. But its orgy ;)

@solidius -
May you explain why? I've worked with PHP a long time and its no secret its terrible at SQL.


oh and orgy you are echoing the post. The ruby script echos the post.name =]


RE: Ruby on rails - Orgy - 12-22-2010

Whoops, fixed and edited my post.


RE: Ruby on rails - Poppins - 01-01-2011

(12-22-2010, 06:57 AM)Orgy Wrote: Whoops, fixed and edited my post.

You can still see what I mean =] The syntax is a lot cleaner than PHPs