What Ruby and Rails Developers Ought to Know

What Ruby and Rails Developers Ought To Know?

Senior

  • Analyse and profile an application for performance and memory issues
  • Analyses and profile an application for security issues
  • Understand database modeling and query analysis
  • Tune a production deployment (Passenger, Thin, Apache etc)
  • Understand and use Ruby metaprogramming
  • Mentoring skills
  • Communication skills
  • Planning and Estimation

Mid-level

  • Setup and deploy a Rails App for production
  • Understand the Rails stack - callbacks, filters, plugins, engines, gems, rack
  • Understand and use Active Record associations
  • Understand and use scopes to define model abstractions
  • Define tests using Cucumber and rSpec
  • Understand and use Object Orientation
  • Understand and use Design Patterns (explain what they are, know some basic patterns)

Entry Level

  • Create and setup a Rails environment
  • Use generators to create models, controllers and migrations
  • Create and use a migration to manage the database
  • Create a unit test using rspec/etc
  • Create a model and basic validations
  • Handle a GET request using a Controller, Model, and View
  • Handle a POST request using a Controller, Model, and View
  • Basic HTML, CSS and JavaScript
  • Basic GIT - clone, commit, push

What should I learn along with Ruby on Rails?

I think I've seen just about every Rails tutorial there is (at least the most well known).

My favorite is the Rails Tutorial by Michael Hartl: http://ruby.railstutorial.org/ruby-on-rails-tutorial-book

The best part is, it's free - as in beer. But it's also very thorough. I've gone through it at least twice to get concepts that I had a hard time with the first time around.

As you go through it, you'll learn Ruby concepts, Rails concepts, and a little CSS and Javascript.

I think Rails is a good choice - it was the first framework I ever picked up, and when you go to other MVC frameworks you will carry over the good habits you learned from Rails.

As far as other things to learn, well it depends on what you want to do. If you want to stick with web development, than you definitely need to learn:

  • HTML5 - I think this goes without saying - but be sure to check out Haml as well at some point
  • CSS - learn the basics first, then take a look at Sass and Less
  • Javascript - most people would agree that JQuery is the predominant framework for basic Javascript work right now
    (manipulating the DOM). But you'll also find people who are fans of
    MooTools and Dojo (as well as a lot of others I'm sure).
  • Javascript Frameworks - JS can quickly turn into a mess if you have a project that is making heavy use of it. My favorite
    Javascript framework is Backbone.js. There are also others that are
    good like - Spine.js, Knockout.js, SproutCore, etc, etc... (there's
    lots of them)
  • Version Control - I really can't stress enough how important this is. Git version control will help you create branches of code so just in case you screw something up, you can just delete the branch and start over without destroying your whole project (it's saved my butt a few times). It will also allow you to work with others on your projects. Start a GitHub account and start storing your code there. The RailsTutorial that I linked to above will get you started with that too.

Hopefully that's enough buzzwords to get you on the right track. If you are just beginning than a lot of this stuff can seem overwhelming, but try to focus on the basics of programming itself for a little while and the rest of it will come together as you go.

Another online book that I am a big fan of is "Learn Ruby the Hard Way". Don't let the name fool you - it's not a difficult book to get through. But it teaches you basic programming skills the old fashioned way - by actually typing out the examples and giving you problems to work through. Well worth taking a look at.

what Ruby knowledge should I have?

This is sort of from the top of my head; I'm sure I am missing a lot. Besides the things mentioned here, understanding programming and object-oriented programming in particular is a must, of course.

A few important language features:

  • Realise that in Ruby, everything is an expression, and be able to apply that principle, even if you think it makes your code unreadable.
  • Closures are mentioned; I would also expect Rubyists to know the differences between blocks and procs (and lambdas) and know how to convert between them. Closure mastery is important to being able to write beautiful Ruby, in my opinion.
  • Operator overloading: know what happens when you define methods named [], []=, ==, +, <<, etc. on an object.
  • Be proficient with most instance methods of Array, Enumerable and Hash (even if you don't know the exact definition by heart). Your Ruby code will be so much more verbose if you don't use methods like collect, inject, join, zip, etc. where appropriate.
  • Thoroughly understand what Symbols are, and when you should use / avoid them.
  • Understand what metaclasses are, know the difference between class variables and class instance variables.
  • Know how object attributes work in Ruby, how you can define them with attr_accessor and friends, and how you can define them yourself.
  • Be able to use modules, both as mix-ins and as namespacing tool. You should also understand how to mix-in instance methods and class methods (or be able to figure out how you could do it).
  • Know the difference between raise/rescue and throw/catch, and be able to use both correctly.
  • Understand how metaprogramming works, and at least have a basic idea of all the methods that allow you to do metaprogramming (mostly hidden in the classes Module and Object).
  • Be able to use a Hash method argument as a substitute for named arguments (even if it's just because it's a common pattern).
  • Know how concurrency does and doesn't work in Ruby.
  • Continuations, even if they're rarely used.

Some vital tools:

  • Know and understand Ruby gems
  • and rake
  • and RDoc.
  • and YAML.

Some framework knowledge:

  • Basic knowledge of Rails would be useful. Even if it's only because the outside world sometimes doesn't seem to know the difference between Rails and Ruby.
  • Know there are other web frameworks than Rails: Merb, Sinatra, Camping, ...

Ultimately, keep in mind that the above is "just knowledge", and not skills. It's probably easy to pick up most of this if you're not familiar with it.

what is ruby on rails?

The Language

Ruby is a recent programming language that shares most of its heritage with Perl and Smalltalk. You can see what Ruby looks like (and try it yourself) at tryruby.org.

Just like you can use PHP to write web pages, you can do the same thing with Ruby.

The Framework

Ruby on Rails is a set of software devices that help you to more easily write a website in Ruby. The primary things they try to facilitate ("make easy") are:

  1. Storing related data (e.g. blog posts and the comments on them) to a database.
  2. Accepting web requests and respond to them programmatically (e.g. check a user's password)
  3. Composing HTML using your data, with layouts and templates to make it easier.

"Rails," as it's called for short, is built with extreme prejudice towards certain application models, particularly MVC. What this means is that unlike PHP, where any .php source file is fair game for any bit of code, most code in a Rails application is written in a particular, conventional place. When people compare Rails to PHP, they often point this out.

There's a lot I didn't cover, but these are Rails' most basic features. To see what it looks like, I'd suggest watching the infamous, "Creating a Weblog..." screencast.

What should I check before my Ruby on Rails web site goes live?

Security

  1. Disable Apache script processing for the public directory.
  2. filter_parameter_logging :password in application_controller.rb (and password_confirmation, credit card numbers etc.)
  3. Make sure you require SSL for login, credit card processing

Performance

  1. Cache everything you can, especially the front page

Look at this question: what-should-a-developer-know-before-building-a-public-web-site

How to prepare an interview for Ruby on Rails developer position?

Here are some responses prepared earlier: What Ruby and Rails Developers Ought To Know?

Some of this is going to depend on the level of the role your are looking at. If I was interviewing someone from the Java world I would be probing to make sure they understood some of the common Ruby idioms, particularly blocks and closures.

Is Rails hard to understand for a PHP developer?

IMO having gone from C# to Ruby on Rails back to C#, is that you can get by with simple apps that fully meet the Rails "opinions" without knowing what goes on. However, you'll run into roadblocks the minute you have to do something that's not a trivial CRUD task or need to implement a CRUD task in a different way than the normal render a form, user hits post, basic scaffolded create controller action way. Once you hit that, you'll need to learn more of Ruby itself to figure out exactly what Rails is doing.

Ruby and Rails or Ruby on Rails

The name "Ruby on Rails" is sometimes shortened as "Rails", or "RoR", which is the same - a web development framework.

You can, of course, use Ruby without Rails, as you can use any other programming language, to build different programs, not only web applications.

You cannot use Rails without using Ruby, because as you wrote yourself, Rails is a web framework built in Ruby. When you build web applications in Rails, you write your code in the Ruby language (there are some other rewrites of Rails, like GRails, which uses Groovy, but this is a different thing).

If you follow the installation guide on the Get Started page, you will see that you first install Ruby for your platform, then install RubyGems (which is a package manager for installing additional Ruby libraries), and then use RubyGems gem install rails command to install Rails with all its dependencies. So you might say that Rails is a library for Ruby.

This installation of Rails then provides a set of scripts, including the rails command, which help you build your web application according to the set of conventions adopted by Rails.

What should I know before changing my development database?

You can do it two ways.

First Way :

Below are steps you can follow to convert sqlite to postgres.

  • Install postgres.
  • Change your Gemfile in your rails app and add PG gem.
  • Run bundle install.
  • Change the database.yml file to use postgres.
  • Run rake db:setup followed by rake db:migrate.

Everything should work as expected, Because with rake db:setup and rake db:migrate you will get identical database as before.

Second Way :

Now rails also provide way to directly change DB from one DB to another, You can check here.

Just use below command and you are done.

bin/rails db:system:change --to=postgresql

Copy Data as well :

If you want to copy data as well you can use yaml_db gem.



Related Topics



Leave a reply



Submit