Ruby on Rails commands and conventions - what are they?

I have been making websites in PHP and MySQL for almost ten years now, but I have never used a framework. This means that I have everything coded and I know how everything works and interacts with myself.

Wanting to expand my horizons, I put together Ruby on Rails to learn another web language, framework, database, etc. I have been following the Ruby on Rails tutorial and everything is going smoothly so far, but what worries me is how much black box it feels. there is too much magic and it just happens because it is. An example of this "magic" includes if I add "resources: users" to my routes file, suddenly I have almost endless possible links like / new / user / 1 / user / 1 / edit, etc. Or if I want to add a column to my db table. I need to do something like this in the console "rails integrate _to_table: type" value and then I need to "rake" the db.

I was able to do stuff after the tutorial, but I don't understand what I'm doing. I know some of this will go through experience, but I want to know how and why Rails does what it does.

What are some good resources, online and books, where I can learn how RoR works?


source to share

4 answers

Yes, it will take a while to learn what all magic is, but eventually you will get there if you stick to it.

The "Bible" for developing rubies on rails

The “Bible” for the ruby ​​language itself is the “pickaxe” book, which includes the authors of the ruby ​​language itself.

Ryan Bates has done the EMPLOYEES of the free sceencasts and he is known for having a really great approach using framework effectively. Every good ruby ​​speed is very high.

Many people find the zombie courses to be really good.

Finally, I suggest my own site with 50+ rails sites:

and 20+ sites for rubies

While you are learning, a good IDE can help a lot . I used eclipse, then netbeans, then rubyMine (from our friend in IntelliJ, famous for his java editor. RubyMine has most of the features. It's not free, but for the price (somewhere in the $ 24 to $ 75 range, depending on specials) it's worth it.



This is for beginners if they want to learn ruby ​​on rails, don't even know Ruby. I can say try it first and download other books.

Just click the link below and see if there are two tutorials for Ruby on Rails 3.0 and 3.2

link to Ruby on Rails for Rails 3.0 and 3.2

for those tutorials you don't need. Ruby backgrounds

Even I like Head First Rails , this book is also good to understand - just rails (no TDB) so you can install the rails environment first and after that go to the link above the tutorial



You can see all the code on Github .

Jose Valim host relief processing app helps to understand a lot of internal in rails too



I would say that the use of the terms "black box" and "magic" is rather inadequate and perhaps even devalued a little. I believe that the difference you feel comes from the fact that Ruby is a very different language than PHP and that it is easiest to write high-level abstractions and conventions in Ruby in PHP. Rails is full of these abstractions and conventions, and it can be quite confusing, especially if you don't have an ideology of how they work internally.

It may not be about Rails that you should be reading. I would say that you should try to understand Ruby first. A good understanding of its blocks, its object model and its mixins is imperative in order to remove the "black box" feeling.

Programming in a modern programming language is not black magic. Debug Fortran code by printing code and using crystals over papers to find bugs.



All Articles