As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
Hi I am from PHP background and in am not really very familiar with these command line process and idea about operation of Rails applications. I want to get fine idea about what is this Activerecord, REST and other important task such as Rake is, more precisely what is this 'task' in Rails anyway. I have been seeing these online screen casts about Rails and I get the idea how to make it work but don't quite know how does that really work, they just extend the class activerecord and use it to their app by making custom class but what is this activerecord, I am really very confused and I am having hard time getting rails inside my brain but I really really want to learn it. Is there any suitable resource to idea idea from basic. Please help.
1) Get the "Agile Web Development with Ruby on Rails" book. Also consider getting several of the O'Reilly Rails book. Also the pragmatic programmer books on Ruby/Rails are great.
2) Join a user group if there is one in your area.
3) Base your education on your background. If you don't know OO(Object Oriented) programming, focus on ruby, if you do (java/c) background focus on the db. If you have both, focus on the view. PHP developers may find http://pragprog.com/book/ndphpr/rails-for-php-developers useful,l though it is from 2008 (Rails 2) and currently out of print so you'll need to search.
4) Make 3 or 4 applications to learn from.
5) Know that a lot of the errors you'll see are very cryptic for newbies. Don't Panic!
6) Screencasts are good, as you have found. Peepcode's (paid, e.g. $8-12 but worth it).
Ruby on Rails Tutorial: Learn Rails by Example by Michael Hartl is a good free online resource to help you get into Rails development.
Here's a few segments from the texts i've been learning from.
I am new to not only Rails, but OOP as well.
http://www.sitepoint.com/learn-ruby-on-rails-9/
http://api.rubyonrails.org/classes/ActiveRecord/Base.html
I also have "Agile Web Development with Rails" as another person mentioned. It's golden, as is anything else in "The Pragmatic Programers" series, i've found.
Rails is a framework. Ruby is the language.
It sounds as if you need to start learning the ruby language. If you stay at the Rails level you will always get that feeling of "not quite knowing how things really work". A bit like trying to learn Drupal or Wordpress without knowing enough PHP first.
I recommend the rubykoans for learning ruby:
http://rubykoans.com/
Start here:
http://railsforzombies.org/
A very nice series of screencasts on the very basics of Rails development. Comes with a great exercise platform that allows you to start practicing in your browser, without necessity of command line tools.
After you get a grasp you may check out this book.
It covers a wide variety of topics, is very accessible, and even tries to solve any potential problems you may run onto.
It's probably not a good idea to start by extending a core class :)
Related
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I am new in ruby dont know the strength about ruby. I have some idea about ruby on rails for building web application so now i want to know about area where we can use ruby like is ruby only useful for web based application or we can write stand alone application also. like C and C++ can we write hardware level code or not. I tried to find my answer on google but did not get it and its my humble request give me guideline or some useful link to explore my knowledge and please dont close this question i am not interested in reputation i am just interested in my answer so please co-prate with me and my question .
Want a full over view and aspect of ruby its all about my future.
Ruby is a programming language and Rails is a web framework for building web applications.
If you are looking for a framework which would enable you to quickly build a web application, then Ruby on Rails is for you. Through the concept of convention over configuration, configuration is only used where necessary, and so, simple applications would no longer require lines and lines of XML.
Ruby programming language combines ideas of the dynamic scripting languages and a strong framework which is object-oriented. Additionally, Ruby on Rails leverages the extensive support of Ruby for metaprogramming, where it derives its elegance as well as its ease of development.
It makes use of code generation features, which makes it easier to start complete applications and promote agile programming techniques. Rails is also unique in the field of web application in the sense that it makes use of two key design features which are DRY or “Don’t Repeat Yourself” and CoC or “Convention over Configuration”.
Ruby is truly object oriented, in the sense that everything is object in ruby. You can built stand alone applications using Ruby.
You can Learn more of Ruby and Rails here.
Ruby is a scripting language so no it's probably not suitable for "hardware level" code. It's a higher level language than c/c++ and probably the only languages it makes sense to compare it to are perl, python and php.
Of those three I would say it's biggest strength against them is the ruby community. A consensus always forms behind good projects and competing projects either disappear or merge. It's no surprise that ruby is the number 2 language on github (let's face it, everybody has to use javascript at some point.) If you compare a common library like nokogiri to python's offerings you get a community that's split in half between beautiful soup and lxml. For php it's even more drastic. Maybe 8 competing libraries vie for the same space (and every php programmer a cowboy who thinks he can do it better).
As in above answer by Mithun, now you got the short brief idea about what ruby is ? and what Rails is ? For more better short description about Ruby on Rails(RoR) is available on wiki page here Wiki page for Ruby on Rails
You can get everything about ruby on rails on this documentation Learn all about Ruby on Rails Development.
For beginners to give startup you can start up with Ruby on Rails tutorials.
In case You are a Experienced developer in other language then you can learn a Basic Ruby language form Learn Ruby Quickly another good learning tutoral is Learn Ruby. Once you are done with basic Ruby then you can start with Rails framework. Rest of the things you can learn while developing application. Best documentation of Rails Framework is Ruby on Rails Guide. You can find everything in one place.
The best thing of this documentation is, it updates all the time when some new releases come.
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
I leaned ruby, but the syntax and the file structure in rails is very difficult for me to understand, there are many things that I need to follow their "rules" to do, for example, I need to generate the db using the migration... It is not suggested to do with typically typing SQL cmd, it makes me very difficult to move on... Any suggestion on how to learn the whole file and how the structure works? Thank you.
Rails is big, really big. It takes time to learn the intricacies of ActiveRecord (the largest piece of Rails by LOC). It takes time to learn how to test a Rails app. It takes time to learn how to build authentication/authorization for users. Keep working, it's worth it.
I can say from personal experience, before you can write effective rails code, you need to understand the routing system. To understand Rails routing you need to understand REST and the params hash.
Run rake routes to see all routes an app will respond to. You need to be able to explain what code runs when each of those routes is requested. You need to know what information will be passed in the params hash for each of those routes.
Rails' migrations make changes to the database repeatable by you and others. Migrations make it possible to put changes to your database under version control, a must if you are collaborating with other developers.
Speaking of version control, you need to learn that too (if you haven't already). Maybe git, svn, or whatever you already know. This is not specific to Rails, but it's necessary to learning Rails.
If you're looking for a good intro text, check out railstutorial.org. I've worked through the entire book, cover-to-cover. The author, Michael Hartl will teach you everything I mentioned above. He will do it in tiny incremental steps, so it will take time. I really like learning from screencasts. If you do too, I can absolutely recommend the railstutorial.org screencast series. I am not affiliated with Hartl or railstutorial.org.
I found http://guides.rubyonrails.org/ to be great
I strongly recommend trying out Rails for Zombies. This is a wonderful tutorial that will not only show you how to use Rails, but will allow you to code in Rails directly in your browser, enhancing the learning process.
After that, I would go ahead and try Rails Tutorial Book. This will have you build a website that is basically like Twitter, allowing you to learn a massive amount of techniques.
Whenever you want to learn something new after getting the basics, I always find myself going to Railscasts to check out awesome screencasts by Ryan Bates.
Good luck, and welcome ot hte Rails community!
You may consider checking out RailsTutorial.org; it takes you from start to finish on a fully functional, test driven web application. This is the site I used to learn Rails, and it helped clear up a lot of the mystery.
Ryan Bates RailsCasts are the industry standard. Just search what you want to know about, and learn:
http://railscasts.com/
Look at the below site. It's quite helpful:
http://www.buildingwebapps.com/learningrails
all the best!!
This is a brilliant (and free) resource -
http://ruby.railstutorial.org/ruby-on-rails-tutorial-book
For a newbie, best way to learn Rails is to follow a book fro start to the end, and implement each of the examples in the book. I would recommend you following books:
Ruby on Rails 3 Tutorial-Learn Rails by Example
Agile Web Development with Rails
I find these two books excellent resources. Make sure you follow these books really well, one book at a time.
Following a book is much better practice than learning in bits-and-pieces from web.
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I have been trying to get into Ruby and the Rails framework for a while now, but somehow I find it quite hard to get started.
I have programming experience with Java, and web languages like PHP, JS. I've read around StackOverflow for a bit and while some recommend learning Ruby first, others recommend to get started with RoR straight away.
I would like to have a strong background of Ruby first before learning the framework. However, I'm not sure which are the right resources to start learning from.
Of course, there's the 'Pickaxe book', but while it's good and make things understandable, it seems to be giving code snippets more than anything else (I've only made it through the first three chapters, still going). Some of the Rails books I've read start up a project and guide you through (like the RoR tutorial book, the Agile RoR book,..). Are there any books out there for Ruby itself that have a similar approach, that is, instead of going over every part of the language, I'd like to build a project and thén go over the different parts of the language.
To get started learning ruby, I'd suggest you dive in to Why's (Poignant) Guide to Ruby.
As far as rails is concerned, I think the official rails guide is the place to start.
I would strongly recommend you Railscasts, is one of the best resources to actually get the way you should code in RoR and what to use
In terms of Ruby, one of the most useful books I have read is Design Patterns in Ruby, with really useful day to day solved problems.
I would suggest Head First Rails. Its the best book I have ever read on Rails.
Also you can read this very good book Getting real on rails by the rails founder
Go straight to http://railsforzombies.org
It's a great way to learn Rails: as efficient as crazy :)
I would suggest Ruby on Rails Tutorial by Michael Hartl. You can read it online. It's also a good introduction to test-driven development, and will get you started on git as well.
To learn Ruby itself, I'd recommend Beginning Ruby by Peter Cooper. It covers the essentials of the language and tools with small practical projects. The chapter on Rails does use Rails 2, so it will give you the concepts but you shouldn't rely on the detail there.
Beyond that, I would suggest either Design Patterns in Ruby or the newly released Eloquent Ruby, both by Russ Olsen. The Design Patterns book is excellent at explaining the standard patterns and demonstrating a Ruby way to approach them. I haven't read Eloquent Ruby yet, but it is getting very positive reviews.
It's not a ruby tutorial, but a rails demo is a good place to learn some rails stuff after you've found out a bit more about Ruby itself
for Ruby though, try hackety-hack
If your goal is developing web applications, then getting firstly the strong background in Ruby is long way, life is too short for this. Rails is also the Ruby, you're learning the Ruby while you're learning Rails. I'd recommend the Ruby on Rails 3 Essential Training, for me it was fresh and dynamic start. Then you can read another great books about Ruby.
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
I've been working far too long with PHP and getting bored with it. I also want to learn a new language.
I've been using Ruby and like it. I have to decide between Rails and Sinatra, so which one would you recommend? Is it true that Sinatra can't be used to build complex apps, and it's only for simple apps?
If you are a "very newbie" with Ruby maybe you should approach Sinatra first: it's really small, well documented and easy to learn. Then, for more complex web applications, you should try Ruby On Rails.
http://railsmagazine.com/issues/5 is a free PDF introductory article I wrote for Rails Magazine.
Go with Rails, it has a lot more documentation/books than Sinatra. It is also more "mainstream" and many IDEs treat rails in a special first-class-citizen way, so it's a good idea to start with it.
While one can write any kind of application on any of the two, Sinatra is designed to be more simplist, so on Sinatra a complex case app might require extra effort.
Oh please Oh please don't start with rails. It's like going into battle for the first time against a Panzer division. Better to start with some restless natives and work your way up. Okay that's not a great analogy but rails is big time overkill for learning. You can pick up Sinatra very quickly and then migrating to rails is a reasonable step up. Same stuff just more useful things. With rails there is at ton of confusing things. They add lots of stuff onto the language, etc. If you don't know Ruby and the foundation classes then just do Sinatra. It's fast, easy and you don't have to learn about migrations, rake, etc.
you should definitely know both, because they were made for different purposes. sinatra is a micro-framework for small applications. rails is a full-blown mvc-framework with lots of helpers for almost everything.
i would say sinatra is easier to learn if you know ruby, because it's very small and follows common ruby idioms. but it's not much more difficult to learn rails as well. the documentation is great and you will find lots of tutorials and howto's on the web.
as i said, it's really good to know both so you can pick the right tool for the job.
First go with Sinatra. It is really simple and easy to understand, plus it covers the basic principles of Rails (MVC architecture, etc). Then, you can move onto Rails. Plus, with your Sinatra knowledge, you can write Sinatra apps in Rails metal, which can make it easy to create APIs.
Either Rails or Sinatra is a great learning choice.
I began working on a project in Rails where I literally knew nothing of web development or Ruby October 2009 (my cofounder helped me break though some initial hurdles and got me to RTFM). I ran into some problems but could code up business logic fairly easily. Recently I began porting a project over to the app engine and using Sinatra as a framework and it's been an incredible learning process. Mostly for learning about all the things that Rails did automatically. It also was useful for seeing a simplified definition of class members and their persistence method (migrations are unfortunately a pita though, background processes to change the format).
You may wish to consider where you will deploy.
Since I'm primarily interested in straight forward apps at a low server cost both Heroku and the Google App Engine fit well.
Rails/ActiveRecord/Sqlite and Heroku works swell
Sinatra/Datamapper/Datastore on the Google App engine flow well.
Rails is also successfully running on the app engine so this choice is open too. IMO Heroku's a little easier to deploy to.
You might want to look at Ramaze in addition to or instead of Sinatra. Ramaze seems to sit between Ruby on Rails and Sinatra as far as features and usablility.
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I have been doing two projects on Rails which have worked out quite nicely but have in the process reinvented the wheel, running (and hot) water and painkillers which are as I have learned subsequently already present in the framework.
So basically, what is the best way to properly get know all the clever parts in the framework that will save time instead of building functionality yourself that has already been implemented? Reading the docs from page 1 onwards? Is there a particular sample app that exposes everything? A particular open source project? All the railcasts? Or something completely different?
A number of people have suggested a series of books, but I might not have made myself clear enough in what I was looking for. I already have a number of Rails (and one Ruby) books that to different degrees explain the Rails framework but that's not really what I'm looking for. Example:
I coded my own function to pretty print numbers as currencies (actually I extended Object to do that for me) because I had no idea that number_to_currency existed. Now that's not a big deal in terms of time but I am sure that I have done my own methods many times simply because I didn't know a similar rails function existed.
So again, how do I find out that number_to_currency (and the myriad of other functions) exist?
This is a bit subjective. But if you haven't read Agile Web Development With Rails, I'd definitely recommend that, with the prior understanding that quite a bit of new stuff has been added since then, and the 3rd edition will be coming out very soon to reflect this. Also, Ruby for Rails is great if you weren't already familiar with Ruby.
Other than that, definitely pick a Rails blog and follow it (maybe Railscasts); go back and read the archives.
Last but not least, before you start inventing something, thoroughly google it and/or post on the Rails forum to make sure it isn't already around.
I second the recommendation for Agile Web Development With Rails, I have the 3rd edition in beta/PDF and it really helped. You find also many guides on this site. Don't forget things like Bort and its fork like this one.
Time.
Really.
The previous answers pretty much cover the best there is in terms of resources to learn Rails. But my personal favourite is Ryan Bates' excellent series of Railscasts. Also, Peepcode has some excellent Rails screencasts
He covers pretty much every little thing one is going to need in any Rails project.
As far as books go, Simply Rails 2 was very helpful
look at Bort, Caboose sample app, some others, then write your own
http://jimneath.org/2008/09/09/bort-base-rails-application/
http://www.railsinside.com/elsewhere/100-7-barebones-rails-apps-to-kick-start-your-development-process.html
I would also look at post-tutorial books like Ediger: advanced Rails, Rappin: Professional Rails, "Art of Rails" (Wrox, can't remember author) Chak/oreilly : Enterprise Rails. Read reviews on Amazon, pick 1 or 2.
The first good way to get to know Rails is by actually making something in it -- anything really, even just a simple blog or something like that. Doing so will show you what you'll need to know and look up to build a good rails app.
I also have two books I've used to learn Rails: Agile Web Development with Rails by David Thomas and David Heinemeier Hansson, and Beginning Rails: From Novice to Professional by Jeffrey Allan Hardy and Cloves Carneiro Jr.
"Use the source, Luke." I was just reading an article on the desirability of reading the Rails source as a way to really understand what's going on. Of course I closed that tab before I saw this question....
I am not sure why the other poster is getting voted down. There is no substitute for actually writing code. Lots of it.
Having a sample project in mind is one of the best ways to start in my opinion. Pick something fun (not a huge idea that you've been dreaming of, but something small and intersting to you) and start working on it!
Some of the sample videos on the Ruby On Rails site along with the Agile Web Dev book really help getting the basics down. When you're trying to solve specific problems, things like Railscasts or Peepcode really really help.
Its sometimes difficult to get things "right" the first time when there are so many ways of doing something with rails. "The Rails Way" book is a good way to find out some of these, but Railscasts cover things the Rails way as well.
Rails is not trivial, a lot of the magic is hidden.
I'd recommend choosing a project that you're going to do. Do not pick "create a blog" or whatever, choose a real project that you want to see happen. Then read a book like Agile Web Dev with Rails and try to code following the examples and tutorials.
Do not hesitate to spend time to entirely refactor your code to improve what you did. You WILL find out that you did everything wrong and have to redo 50% of your code. It's impossible to get it totally right the first time.
My favorite way is to watch the Railscasts:
http://www.railscasts.com