Discuss Ruby. I need help getting started. in the Ruby Programming forum on Dev Shed. Ruby. I need help getting started. Ruby and Ruby on Rails programming forum covering Ruby Tips and Tricks, Best Practices, and agile development with Ruby on Rails.
Posts: 366
Time spent in forums: 2 Days 3 h 16 m 51 sec
Reputation Power: 9
Ruby. I need help getting started.
Hello folks!
I'm a nub at ruby. I have the book caled Agile Web Development with Rails (2nd Edition) and I pretty much know a half decent amount.
Anywho, what I need to do is create a page that allows people to do these things:
1) Submit content (Logged in)
2) View content (Logged in or noe)
3) Create an account, and be either a finder, or a findee. (Both can submit content)
4) Let the finder be able to find findees based on the location(s) they listed themselves in.
I just need help getting started. Once I'm started I'm sure I can figure out where to go from there.
Thanks a bunch
-Amir
__________________
I have summoned you here for a purpose
Posts: 5,538
Time spent in forums: 1 Month 3 Weeks 1 Day 19 h 30 m 28 sec
Reputation Power: 1050
I'm a rubyer, but not a railser, so i've lifted the next chunk off the rails site:
Code:
rails path/to/your/new/application
cd path/to/your/new/application
ruby script/server
You're running Ruby on Rails! Follow the instructions on http://0.0.0.0:3000/
You'll need to set up models and controllers then and continue like any other rails application. Try looking at the site
http://www.rubyonrails.com/
Posts: 366
Time spent in forums: 2 Days 3 h 16 m 51 sec
Reputation Power: 9
Quote:
Originally Posted by LinuxPenguin
I'm a rubyer, but not a railser, so i've lifted the next chunk off the rails site:
Code:
rails path/to/your/new/application
cd path/to/your/new/application
ruby script/server
You're running Ruby on Rails! Follow the instructions on http://0.0.0.0:3000/
You'll need to set up models and controllers then and continue like any other rails application. Try looking at the site
http://www.rubyonrails.com/
Thanks, but thats not exactly what I'm looking for. What I need help doing is getting the baseline of code. Like all the files and stuff.
Posts: 5,538
Time spent in forums: 1 Month 3 Weeks 1 Day 19 h 30 m 28 sec
Reputation Power: 1050
Follow the docs. I can't just write your code for you, that's not what i'm here to do. I'm here to provide assistance with troubles you're having and point out helpful links.
Posts: 271
Time spent in forums: 3 Days 1 h 8 m 16 sec
Reputation Power: 42
Just few quick questions. I didn't want to open separate thread just for this.
How is Ruby on Rails used on site? Is it something like Perl (scripting), or Ajax (framework)? Why would someone prefer Ruby over Python/Perl for scripting?
IMHO, Perl is most powerful for that purpose.
Posts: 271
Time spent in forums: 3 Days 1 h 8 m 16 sec
Reputation Power: 42
Quote:
"my string, hello world".reverse.split().reverse.remove(2).each {|x| puts "and the token is: #{x}"}
Nice...
Then why most people use perl instead of ruby for scripting? It's not that hard to learn new language.
BTW, I learned PHP&MySQL basics yesterday, and i got book about Joomla! and started reading it. It's amazing what can you do with PHP&MySQL...
And i'll probably need something for scripting sometimes. As i (still) don't know Ruby/Perl, i wanna know which one's best. Perl has excellent string manipulation and regexp, and ruby... i don't know.
Posts: 5,538
Time spent in forums: 1 Month 3 Weeks 1 Day 19 h 30 m 28 sec
Reputation Power: 1050
Ruby is the better language, perl has CPAN and is installed on more servers.
Essentially, ruby will make more readable code and is more fun to piss around with, perl is usually quicker to develop applications because there's usually a module that does exactly what you need. PHP is also a scripting language fwiw.
Posts: 271
Time spent in forums: 3 Days 1 h 8 m 16 sec
Reputation Power: 42
I'm still PHP beginner. Is it smart to use other scripting languages? PHP supports OO, Polymorphism, etc...
btw, if i ever need scripting language, i'll try Perl. Good readability isn't important to me. Perl has big community, and lots of modules.
Also, I rarely see someone looking for Ruby programmers. I see that PHP/MySQL/Perl programmer are most wanted. And i'm business oriented
Posts: 5,538
Time spent in forums: 1 Month 3 Weeks 1 Day 19 h 30 m 28 sec
Reputation Power: 1050
I could have sworn you came to this forum claiming .net experience...
PHP is the most wanted IME, perl a touch less so. I'd take php, you will need a good 8 months to properly get to grips with perl (buying a small o'reilly reference has been essential to my perl programming, the syntax is often so tricky that i want to doublecheck it instead of testing and risking it being wrong)
Posts: 271
Time spent in forums: 3 Days 1 h 8 m 16 sec
Reputation Power: 42
I have much experience with small-medium scaled application developing in C#. I wanted to learn ASP.NET, but my MSSQL died in one accident, and unfortunately, i'm on Dial-up, and my pirate got busted, so i can't get VS2005 from him. (Murphy's laws? ).
Now i want to learn PHP/MySQL. I'll leave ASP.NET for later.
Posts: 2,537
Time spent in forums: 1 Week 2 Days 18 h 17 m 47 sec
Reputation Power: 68
Which language is best depends on more factors than you or I can imagine. In terms of expressiveness Perl may well be better since it gives you the flexibility to create new (and in theory) cleaner abstractions.
In practice it's very rare for Perl programmer (or most programmers for that matter) to "waste time" on abstraction.
This goes beyond proper code formatting: if you have 10 seeming random operators coming into play no amount of indentation will make it read well!
The typical solution to poor abstraction in programs is to littler the code with comments detailing every little detail, violating the DRY principle. When the code changes slightly and the comments are outdated these comments make your code even more cryptic .
(Of course, poor code can be written in any language, but so can good code).
Ruby, which has less potential for expression than Perl, oddly manages to produce cleaner programs in far more cases. This is in part one reason for Ruby's increasing success.
Perl may be more productive for the moment but as more modules become available for Ruby the gap between what you can do quickly in each language is rapidly decreasing; spurred on by the fact that once a module has been written it can be easily maintained, and not just by the person who wrote it.
If I had a penny for every time I've gotten a module from CPAN that didn't work, or was out of date I'd have around 10 pence .
It sounds low but I done relatively little programming in Perl, so the number of dud modules is actually quite high*. Or at least for what I was doing.
So choosing a language based on the short term productivity gains is just asking for trouble.
This is without going into the relative merits of either language; the benefits of there abstract or concrete syntax or the absence of this or that feature. Both are Very capable and will serve you well so why not learn both?
Perl is the current standard scripting language (especially on *nix) but this is changing slowly. There have been several books pointing at Ruby as the Next big industry programming language.
You may notice that more and more *nix distros are relying on utilities written in other languages like Python, Ruby and even Haskell.
I think, eventually, we'll all get back to writing Lisp .
I hope this was helpful,
Mark.
* Most Perl code is messy IME and messy code is hard to maintain so it doesn't get maintained.
__________________
programming language development: www.netytan.com– Hula
Posts: 271
Time spent in forums: 3 Days 1 h 8 m 16 sec
Reputation Power: 42
Excellent post, Mark
Quote:
Both are Very capable and will serve you well so why not learn both?
Both languages have same purpose. Why should i learn both if I'm gonna use only one? I wanna learn the one which is more powerful, and has good support. When i learn it, i'm gonna use it for everything, and i'll ~master it after some time.
Ruby is similar to Python. It has clean code, and is powerful.
Perl has the best support for regular expressions (very important feature to me).
I'm still not sure which one is better for me... I wanna develop MMORPGs like http://www.darkthrone.com , hattrick , or herowar . I already have few ideas for some MMORPGs.
How can scripting language help me here? I just learned some advanced stuff about PHP. PHP has everything i need for MMORPG. Now i'm confused...