Noob Rails ? about learning Rails - ruby-on-rails

I have been programming for a while and for the past 3 or 4 months have been learning ruby. I am not an expert by any means but I believe I have the basics down.
I decided to start learning RoR and bought the "Agile Web Development with Rails 3rd Edition" and have been dutifully going through the chapters one by one. Currently I am in chapter 8 and have had no problems so far.
My question is I know I have learned several things so far and I know that I am starting to get a sense of the Rails framework I have this fear that I am just not learning as much as I should. Some things I get and understand the interconnections while I feel on other things I am just going through the motions and don't fully comprehend the total interconnectivity. Now, there is still a large amount of the book for me to complete. I guess I am just wondering if I complete this book what should I expect to be able to accomplish on my own and what should be my next steps.
Thanks

if you complete that book, and fully comprehend everything, you'll have a ton of the rails framework behind you. the only way to master it, is by doing it. write apps, even if they're nonsensical. i wrong a full website alongside the depot app when i went through the first sections of that book. then i tried to find a way to tie-in every part of ActiveSupport covered, then ActiveRecord, etc.

After reading the same book, I was able to build a web application. The building of that web application helped me make all of the connections and learn all of the things that weren't covered in the book. There's absolutely no substitute for putting what you are learning into practice. It's the difference between learning German from a book and waking up in Munich with hangover and no money and making your way home.
Build something.

In addition to the (good) answers already given, I'd suggest sitting down and reading through at least strategic sections of the Rails codebase. The effort of trying to figure out the overall structure of Rails as a piece of software will cement a lot of the connections in your head. On top of that you're likely to learn some new things about Ruby. Might also be well worth your time to read through some good open source apps done in Rails to see how people approach various problems.

Also go through the excellent Ruby on Rails RailsCasts by Ryan Bates.

As I always say to people who's learning something new or improving their knowledgements: "No pain, no gain".
Get through the Agile Web Development book (I'd recommend you the 4th edition though as it deals with Rails 3). Also, take a look at this tutorial: http://guides.rubyonrails.org/getting_started.html, watch some http://railscasts.com/ for best practices, play around with the rails console (rails c in the project directory) and just make your own application!
Think about something cool you'd like to achieve, even if you still have no idea how it should be done. You will get some decent basic knowledges in no time! Personally, I started programming on Rails 3 weeks ago and today I already have done a complete manager with ldap user authentication, ssh connections, XML parsing and YAML writing, stuff I wouldn't imagine I'd be able to do in so little time...

I would like to share with you this blogpost there is a lot of information about to learn Ruby and Ruby on Rails you will love it http://blog.crowdint.com/2013/12/06/the-path-of-the-padawan.html#!

Related

Quickest framework to develop a Facebook App - CakePHP vs. Ruby on Rails

So I know this has been asked before here:
How to start facebook app?
But I am banking on it being a little old and also hoping I have something slightly more specific to ask. So here goes:
I want to build a basic Facebook app, that would require a basic database, a simple front page, and obviously the ability to share/Like over the feed. Now my main concern is I want to do this quickly and easily, without having to deal with as many mundane details as I can avoid.
I was thus looking at CakePHP and Ruby on Rails as frameworks. However, I am not familiar with either of these technologies (I do have a software background, but it is mostly C/C++/Java). So which do you think would be best for me to pick up for this project that will enable me to quickly and easily just 'build' something like this for Facebook?
(Also note that I need a free hosting provider as I don't have money to finance this hobby now, so I'll need to know which hosting companies support these frameworks for free).
Any help is appreciated!
Rails, definitely, there are infinitely more and better resources available to learn from and you can get fantastic free hosting (for small scale apps, plus easily scale for cheap) on Heroku.
To get started, see:
Rails for Zombies (free)
Rails 3 Tutorial
Railscasts
I was in the same situation as you last fall, I knew a fair amount of PHP but had never worked with an MVC web framework before. I tried to learn CakePHP, struggled for a while, then thought I'd spend just one weekend giving Rails a chance. I had never touched Ruby before, but I was so curious about Rails that I picked up a copy of Beginning Rails 3, and I figured I would just take one weekend and see how hard it was to learn some basic Ruby and get an idea for how Rails works.
I thought going into that weekend that there was really no way learning a whole new language could be worth it, even if the framework suited me better. I'm so, so glad I gave it a chance. Ruby is awesome, the community behind it is phenomenal, and the amount of documentation, screencasts, tutorials, etc. are out of this world. Ruby is also a lot of fun to work with, and very easy to learn. Try for yourself and see what you think.
Rails is definitely the way to go (vs CakePHP at least).
The answers so far only scratch the surface!
CakePHP is to PHP what Rails is to Ruby. From the onset, CakePHP was developed to mimic the "Rails" way on things, and has done really well so far; but if you're starting from scratch; you need to remember you have to:
Set up a development environment, which in turn involves
Install the language (PHP / Ruby) and Database (MySQL?)
Learning some basic server configuration(s)
Choosing which one is right for you, and setting it up (Apache, Nginx, Passenger etc)
Get the framework up and running
Learn the underlying language
Learn the framework
Learn the Facebook API, and their developer guidelines
Actually Build the application
Test it, debug and submit for approval
Launch it
Having developed in both CakePHP and RoR - if you're coming with no web development background and you're looking to start; dive in with either. Honestly, it'll be the same learning curve for you! You will find the setup, learning, development and deployment easier in CakePHP - PHP is one of the most popular languages. If you want to learn a language and framework also to improve your skills as a programmer and developer, then you want RoR - it's got strict conventions that do twist your mind but once you get the hang of it, there's no looking back (and these are the same conventions that CakePHP is trying to bring to the PHP world!).
The official documentation for both is excellent, they have amazing (and very active!) communities where even the silliest question is answered. There are also excellent (free) hosting platforms available, that make use of Git and make deployment a snap (PHPFog and Heroku).
It might be worth mentioning that RoR is considered the new boy on the scene, the trendy framework thats bringing with it a lot of rapid changes in development methodologies, and that RoR developers also are in very high demand.
Also - considering the simplicity of the App - have you considered using Sinatra (a very minimal framework for Ruby)? You may find that the easiest, and it'll be an excellent stepping stone if you later wanted to get into Ruby on Rails.
OK, this thread is about 1 1/2 years old by the time I write this. But wanted to add something to the discussion for anyone finding this, as I did doing a search on RoR vs CakePHP.
As of this date, and during the last 12 months, RoR is trending about 3 times what CakePHP is, according to Google Trends. Now, this is just RoR vs CakePHP.
When I add Facebook into the mix, RoR/Facebook is still about 3 times CakePHP/Facebook, but if you look at the last 3 months, CakePHP/Facebook drops to zero. Link.
Right now, the trending languages for Facebook apps are C, Java, & C++. Link.
If you are more familiar with C/C++ then you will most likely find the learning curve for PHP a lot less steep : )
For something like a Facebook app and already knowing C, I would look into CakePHP. If you have time in the future look into RoR as it is an amazing platform.
Don't get me wrong, I love CakePHP. But if you don't have a background in web programming (PHP in particular), even CakePHP can take quite some time to be familiar with. RoR would be at the same learning curve, I suppose.
Besides, to deal with facebook API, you'll have to interact with it at 'base' level (by which I mean, the framework can't help you much with it). So to "quickly and easily just 'build' something like this for Facebook?" I don't think it's quite possible.
Anyway, if you still want to do it, CakePHP would be easier for you because PHP syntax would be similar to C and Java. But Ruby is an interesting and unique language if you have the time to spend on it.

Beginning rails

I have been doing desktop applications since I have started programming, and I have not really looked at the web side of things. Seeing how fast this market is growing, I convinced myself that I should learn a web framework. I learned some PHP, and I found it to be quick, but, after projects get beyond small, it becomes a hassle.
So, looking at recommendations online, I took up Ruby on Rails. Now, when I go through the ruby on rails guide, I don't really feel like I'm understanding anything, or really writing any code. I just feel like I'm editing configuration files. Is this normal? Should I just keep going through the guide, and it will all come to me later?
FYI, I'm using this as a tutorial.
When I coded in PHP, I immediately understood what the code was doing, but, with Rails, I really don't understand how all of it comes together.
EDIT: I am good at Python and C, and not bad at Java, if that changes your answer.
Before you start on Rails, I would start with the pick axe book (Programming Ruby
by Dave Thomas http://www.pragprog.com/titles/ruby3/programming-ruby-1-9) since you have previous programming exprience and make sure you have a solid grounding in Ruby.
Then I would go through the Ruby Koans and do some of the ruby quiz's. Both are fun and great practice.
Then I would start with either Michael Hartl's http://ruby.railstutorial.org/ruby-on-rails-tutorial-book or Agile Web Development with Rails (http://pragprog.com/titles/rails4/agile-web-development-with-rails) make sure you are getting the latest edition.
I would suggest Michael Hartl's tutorial first. Don't worry if you feel led by the nose a bit. I found Agile Web Development with Rails, as with a lot of the PragProg books, to expect me to go out and do a lot of research on my own along the way, like in the guides, because the topic is so big.
Then, if you don't know Javascript, you are going to want get a solid grounding in that as well. The Crockford book is highly recommended, but i found that I had to go through something basic first before I could understand a lot of the points that Crockford was making.
Just remember, despite the fact that everybody talks about how powerful/beautiful Ruby is (it is!) and how wonderful rails is (it is!), normal developers aren't going to tell you that it is easy to learn, at least, not the ones that understand the complexity and depth of both. With both you have to work pretty hard to understand them. With Rails, it takes a while to remember all the conventions.
Maybe you should try other tutorial, for example this one http://ruby.railstutorial.org/ruby-on-rails-tutorial-book
In this tutorial, author shows how to build a real app, IMO this is the best way to learn a new technology, by practice.
It's not normal - it's nice!
With Ruby on Rails we stick to a convention over configuration principle.
You should understand rails conventions. With that principle you can get a working site in 15 minutes without any configuration or coding based on best practices.
If you need something special you can code it by your own.
Small advice: buy a book. It is worth it.
I would strongly recommend this online tutorial - "Rails for zombies" -> http://railsforzombies.org/
I have walked through this tutorial and I know two other friends that have started with Ruby on Rails using this site. It is really fun and easy to begin coding.

I'm excited about a personal project, should I do it in PHP or Rails ( but I have to learn Rails first )

I started learning Rails only a few days ago, but in the mean time I became very excited about a personal project. The project is quite hefty and would require several months to complete.
Right now, I can't wait to start doing that project but I'm a bit reluctant in writing it in PHP.
I've been working in PHP for a little more than a year now and I can find my way around it fairly well. Ruby on Rails however is a mystery to me and I will probably need two or three weeks before I can even start coding poorly in Rails.
So my question is, should I start my project in PHP and postpone my Rails studying or should I first get the basics of Rails and do the project in Rails.
The project consists of dealing with a lot of data taken from google search.
This sounds like a stupid question, I know.
Thanks.
A personal project that you are excited about sounds like a perfect opportunity for you to learn Rails.
There is a bit of a learning curve, but the time spent will be well worth it. Spend lots of time watching Railscasts, try things out, and have fun!
I was in the exact same situation recently, and I went with Rails. I'd definitely recommend it. It's worth putting in some effort to learn Ruby first - I read Why's (Poignant) Guide and that set me up well. Also, get Agile Web Development with Rails - it's a great introduction. If you have the time, you could learn enough to get started in a week or two.
If you can spare the time to go through Why's Guide and AWDwR before you get started properly then do. Otherwise, maybe PHP would be a better choice. Also, if you're worried that your excitement about the project will wane if you don't get started on it soon, go with PHP. You can always rewrite it in Rails!
Not a stupid question.
As you will see in a number of other answers to a number of other questions around here:
Never pass up the opportunity to learn something new.
I say try it in Rails.
do it in rails - there's a good and up-to-date ebook here that will help you learn: www.railstutorial.org/book

Ruby On Rails Web Application Development From Scratch?

Background
I am interested in getting to grips with some Ruby On Rails. I've got 4 years experience programming in C#, ASP.Net, ASP.Net MVC, SQL Server and more recently Silverlight etc. Obviously I've got a pretty good understanding about the various implementation routes that you can go down when writing web applications using C#, the issue is that I have literally no clue about Ruby On Rails, other than that Ruby is an awesome pure object oriented language and that Rails is a very quick way in which to build web applications using Ruby.
What I'm After
So essentially I'm after a session that fills in the blanks, and helps me to understand the various ways of building web applications using ROR. On top of this, i've found a few tutorials but they seem to be quite vague, so any documentation/samples would be very handy to help get me started.
More Detail
Popular IDE'S to use for development (I've heard RubyMine is good from JetBrains).
Possible database implementations to use (I know MySQL is an option but which version?)
Is HTML/CSS used to style the web apps?!
Interface plugins if used?
General route to producing a highly Web 2.0 site that encompasses a fantastic user experience and a beautiful interactive interface.
...You get the idea, I just need a bit of guidance getting clued up.
Help greatly appreciated :-D
I'd highly recommend starting by reading:
Programming Ruby (also available online)
Agile Web Development with Rails
You should start with the first one, but don't read it all the way through. Once you get the basics of Ruby down, you can switch to the Rails book, but feel free to switch back and forth as you get more familiar with both Ruby and Rails.
The books are both very well written, and they're actually fun to read as far as technical books go. They do a great job of explaining the basics to a total newbie and also really digging in deep. You'll have all of your initial questions answered within a few hours.
When I tried to get into Rails, I bought this Rails for .NET Developers. It was quite useful to get going. After that, the most value I found was watching railscast videos.
For an IDE, I use Netbeans.
Different people learn different ways, but one thing I find to be very helpful for getting a real "feel" for Ruby on Rails is screencasts. The Rails site has a whole section devoted to screencasts. For example, with the 15-minute-blog video, you can actually watch someone work on the blog app and see all the steps along the way. It's not necessarily more informative than, say, a book, but it can be easier to grasp when you're actually seeing it.
The official Rails Guides are kept well up to date -- begin with the Getting Started guide, Railscasts provide quick how-tos on lots of common tasks, and the Agile Web Development with Rails (3rd Edition) book is excellent if you want to sit down and read how it all works.
There's also tons of sample code on GitHub, where you'll find just about all the plugins available as well as lots of well-designed Rails apps that will show you all the best practices.
Regarding specifics you asked about:
Many Rails developers don't bother with an IDE (they just use text editors such as TextMate on the Mac). MySQL is popular for production but for local development, Rails is set up to use SQLite, which is quick and easy. Many developers are moving to a NoSQL datastore such as MongoDb because development is quicker without schemas and migrations. You'll use HTML and CSS but you may use Haml to abstract your HTML templating. For an interactive "Web 2.0" site (as you ask) you'll want to be become familiar with jQuery and CoffeeScript.
You asked the question back in October 2009 but I'm sure other people will continue to want suggestions for the best way to get started with Rails. I hope you've already become a Rails ninja!
i started ruby on rails a few days ago using http://ruby.railstutorial.org/ruby-on-rails-tutorial-book by Michael Hartl. so far so good.
This is my experience, I'm at the stage where I can build simple apps. I am comfortable with code, at least to go to the right sources.
Hartl Tutorial ... go through this at a steady pace, just to understand the overall basics. No way you can absorb everything there.
Why's poignant guide is great to understand how to read code through a story, making things enjoyable and memorable.
Agile guide to rails. This put eveything together, I went through the exercises but stopped near the end. I read what I thought I needed to know how to build something my work would use.
Using railscasts to supplement my app building.
I would recommend as resouces to use apis, irc #rubyonrails, and stack overflow. You would be surprised how people contribute and help you through problems you encounter.
Re: IDE
Most Rails developers use VIM. Or at least the better ones use VIM.
It's more powerful than an IDE. I know and use at least 5 languages and VIM works well for all. I use YADR. If you were with a team, sometimes using VIM or Emacs or Geanie are your best options.
Re: Books
You should read a Ruby book before anything. And by read, I mean, try the examples.
The best book I've read on Ruby on Rails is probably Ryan Biggs' book.
Engineering Long-lasting software would be a good book focused on teaching you some Ruby fundamentals for practical reasons.

Learning Ruby on Rails with Pragmatic book

I only have a background knowledge of java and C, and a bit of unix (learned from the first year Comp Sci) and i do know bit about HTML/CSS... anyways so i've started using the book and the book said that we don't need to know html or ruby or css and that book would be kinda teaching all that as we go along..
And i'm at the part where we create a cart for the online store website, but i find that they just add a ton of html/css of ruby codes without really talking about it, and moving on.. I heard that this book was the best of there for ruby, i just focus on the stuff they mention, but i was wondering if i'm supposed to actually just look at other stuff when they add the CSS or HTML tags or ruby codes... i feel that this book is flying, without much explanation..
Should i just keep going with the book, or go back and study every line of all those codes they just put in the program?
I used this book in my first job and failed miserably. It was my first time and and didn't knew Ruby but was asked by my team leader to just go by this book. And I miserably failed to do anything other than the said methods in the book.
I suggest if you want to t have good grasp at web development, you need to know HTML, CSS and Javascript at a very decent level. After thatstudy Ruby. Then you can go through this book.
Now there was once an article online by a prominent fellow in the rails community saying something worse about this book. But since it isn't online anymore I assume that the blogger realised he was wrong and the book is indeed good. So just go about and find it for yourself. But as I said go through all the other necessary topics I mentioned before you jump into rails.
I've used the this book, is good but as you said they some things lack explanation. Usually the best thing you can do is pretty much use google or stackoverflow to lookup this things that you just don't understand. I was pretty much like you, 0 HTML or Rails, but after 2 weeks of reading code and looking for explanations on the web I can now pretty much understand all of the code, and afterwards everything is pretty straightforward.
My best recomendation is that you modify all of the code they give you, this will force you too lookup everything you don't understand. The good thing is that the code on the book is pretty good, and they try to teach you good programming practices on the way so stick to the book.
The HTML/CSS should be easy to pick up, but if you're having trouble following the Ruby code, I'd suggest you start with a Ruby off-Rails book. The Pickaxe book comes to mind. You can find the 1st edition online. Also the Ruby Way helped me to "get" the Ruby way of doing things.
I would continue with the book, it really is good. However, you might want to look at some other books as well including (but not limited to) Simply Rails 2 and Learning Rails.
I found the Pragmatic book to be a good start and the other two to complement it rather well. After that, just have some fun digging into some of the internals.
I would study the code thoroughly. I think you'll find that (if you keep working at it) ROR is pretty amazing.
I think your best bet will be to keep going at a steady pace on the book - going into more detail if you get lost, and if necessary grab a snapshot from online to keep pace if you break things.
From there I would start branching out into many of the other excellent resources available. Pragmatic Programmers have a book called Advanced Rails Recipes that I hear is also fairly good.
Since Rails is still moving rather quickly your best bet will likely be, once you have a handle on things, to start following some of the latest news. Ruby Alltop might be a good place to start looking for more resources. I would suggest going through as many Railscasts as you can - they are pretty much the definitive place to pickup Rails concepts quickly.
I would highly recommend supplementing the books with screencasts. Ryan Bates in particular has done an enormous amount of Rails screencasts at Railscasts, which are freely available. He has also done some paid screencasts for the Pragmatic Programmers site which are much more in-depth, and very helpful.
Creating multi-model forms was a bit of an early sticking point for me, and Ryan's Pragmatic Screencast series on forms was very helpful. I would also recommend the ActiveRecord series.
I started Rails when it was 1.3. I followed the second edition of Agile web development with Rails. I was facing hard time finding how the things were happening. As I did not have any experience of web development this was more painful. I followed the book and created the depot application twice but I still did not get very much from this book.
I was having trouble understanding the Ruby code mainly. As said by "listrophy" on #rubyonrails
Using rails without knowing ruby is
like trying to write a menu at a
chinese restaurant with only an
english-chinese dictionary.
You should get yourself up and running with Ruby first only then you should dig into Rails. I highly recommend you the Ruby for Rails book by David Black but for Ruby only. Read part 2 and part 3 only from this book. The things about Rails in this book is crap IMNSHO. When you are done with Ruby from this book, carry on your journey with the Agile rails book.
When you are done with all this, you can check out The Rails Way, The Ruby Way, Pro ActiveRecord books.... The list goes on and on... :)
The depot application in the Agile book is a great example of a sample Rails application. However I suggest you to check out Open Source Rails for some more sample apps. Rails Guides also have some very good tutorials on rails. As said by everyone else Railscasts by Ryan Bates has some very high quality free rails screencasts.
FYI I have a little knowledge about HTML and very little about CSS. You can not learn these technologies by following some book. You will learn these with the experience and time. Although some books can give you a good start. But I do recommend you to learn Javascript-Ajax and stuff. For this purpose you should use libraries like Prototype or Jquery. I recommend Jquery as this is much more easier to learn and also more powerful.
HTH :)

Resources