Top products from r/rails
We found 55 product mentions on r/rails. We ranked the 49 resulting products by number of redditors who mentioned them. Here are the top 20.
1. Practical Object-Oriented Design in Ruby: An Agile Primer (Addison-Wesley Professional Ruby Series)
Sentiment score: 2
Number of reviews: 4
Addison-Wesley Professional
2. Rails AntiPatterns: Best Practice Ruby on Rails Refactoring (Addison-Wesley Professional Ruby) (Addison-Wesley Professional Ruby Series)
Sentiment score: 2
Number of reviews: 4
3. Eloquent Ruby (Addison-Wesley Professional Ruby Series)
Sentiment score: 3
Number of reviews: 4
5. Refactoring: Ruby Edition: Ruby Edition (Addison-Wesley Professional Ruby Series)
Sentiment score: 2
Number of reviews: 3
6. Agile Web Development with Rails 4 (Pragmatic Programmers)
Sentiment score: 2
Number of reviews: 3
7. Metaprogramming Ruby 2: Program Like the Ruby Pros (Facets of Ruby)
Sentiment score: 1
Number of reviews: 3
10. Growing Object-Oriented Software, Guided by Tests
Sentiment score: 1
Number of reviews: 2
Addison-Wesley Professional
11. Rails 4 Test Prescriptions: Build a Healthy Codebase
Sentiment score: 2
Number of reviews: 2
Pragmatic Bookshelf
12. xUnit Test Patterns: Refactoring Test Code
Sentiment score: 1
Number of reviews: 2
13. Working Effectively with Legacy Code
Sentiment score: 2
Number of reviews: 2
Prentice Hall
14. The Rails 4 Way (3rd Edition) (Addison-Wesley Professional Ruby)
Sentiment score: 1
Number of reviews: 2
15. Domain-Driven Design: Tackling Complexity in the Heart of Software
Sentiment score: 1
Number of reviews: 1
17. Algorithms (4th Edition)
Sentiment score: 1
Number of reviews: 1
Addison-Wesley Professional
18. Ruby on Rails Tutorial: Learn Web Development with Rails (3rd Edition) (Addison-Wesley Professional Ruby)
Sentiment score: 0
Number of reviews: 1
It's never too late, I too started when I was 27. My advice is to meet others, both starting out like you are and very experienced. Also reach out to companies you like, Ruby/Rails speakers, even DHH answers emails he gets. But don't go for the bootcamps. They cost an arm and a leg, don't teach you anything you can't learn by yourself and are very demanding (i.e. 60h/week).
A bit about me, to show you it's perfectly possible to get where you want to be:
I had some basic knowledge like you did but was very much outdated on most stuff web (last time I did HTML was when tables were a good way of laying your page out...)
I had 4 months where I couldn't work so I decided to put this time towards turning my life around and getting proficient enough to get paid to write webapps.
I started with M. Hartl's tutorial and this book: http://www.amazon.com/Agile-Development-Rails-Facets-Ruby/dp/1937785564/ but I was quickly overwhelmed.
So I took a step back and spent some time to learn Ruby first with rubymonk, the Ruby Koans and by asking a lot of questions on #ruby @ freenode. The people there were very helpful and I found this IRC channel to be crucial in my learning.
At the same time, I was getting up to speed on CSS and HTML with treehouse. Although their acting is a bit annoying at times because you feel a bit like a child and the things they teach are a bit outdated, you still can get a solid grasp on CSS and HTML in a few weeks.
Then I tried diving into Rails again. And again, it was too much. I was getting frustrated because a lot of things in Rails are automagical and you don't really understand where they come from.
I was fortunate enough to have a very active Ruby/Rails meetup group in my city. It took a few missed meetups to build up the courage to finally show up. There, I discovered that they were planning to run a railsbridge event where, for one weekend, volunteers assemble classes of about 10 persons and teach you Rails. There were 3 levels, complete beginner, intermediate and advanced. I took the intermediate class (which was actually an intro to Rails) and it gave me enough ammo to finally get on with M. Hartl's tutorial.
Over that weekend, I also met another guy who was also getting started with Rails. We eventually did the edX course together: https://www.edx.org/course/engineering-software-service-uc-berkeleyx-cs169-1x, helping each other out and doing the required "homework" together. Railscasts were also helpful. It hasn't been updated in a very long time now and probably won't be ever again but some of the stuff is still very relevant. The pause button is very helpful because Ryan explains quite a lot of stuff over a short period of time.
By going regularly to the meetup, I also befriended much more senior devs who I could come up to with questions. One of them knew of a junior position at a startup that needed to be filled and asked me if I was interested. And this is how I got my first paid job as a developer.
The takeaway is this: don't hesitate to reach out. Most people in this field love what they are doing and are very happy to give you some of their time either by giving advice, recommending you for a job etc. The key is motivation. If you can put 4-5 hours a day for the next 6 months, you can definitely get to a point where you have enough knowledge to be a junior dev. Don't forget to build things in the process and put them on Github.
Good luck!
> I am a relatively new to development
If you're new to development, it's hard enough just to learn Rails by itself. In addition to the Rails concepts (e.g. ActiveRecord, view rendering, etc.) there's Ruby, databases/SQL, servers, HTML, CSS and JavaScript. Even if you're already comfortable with all those things, it's pretty hard to throw testing into the mix. When I first got started my question was, "What do I even test?" Do I write unit tests? Integration tests? View tests? Controller tests?
My advice would be to forget about Rails for a little bit and just practice testing Ruby by itself for a while. Then, once you're comfortable with testing Ruby, it will be easier for you to go back and try to write some tests in Rails.
> What is your recommendation on if I should focus on rspec vs minitest?
A person could make technical arguments for either. Deciding which testing framework to use depends on your objectives. If you're teaching yourself testing to become a more marketable developer, then I would definitely recommend RSpec. Almost every Rails project I've worked on (20+ production projects) has used RSpec. Having said that, it's less important which tool you choose and more important that you have a solid understanding of testing principles. I personally chose RSpec and I'm glad I did.
Here are some testing resources I often come across:
Growing Object-Oriented Software, Guided by Tests (awesome book, highly recommended)
Rails 4 Test Prescriptions (just started it, seems good so far)
Working Effectively with Legacy Code (super good book and more relevant to testing than it might seem like)
Everyday Rails Testing with RSpec (haven't bought it yet but seen it recommended a lot)
Destroy All Software (just bought it today, seems good so far)
Lastly, I myself created what I call a Ruby Testing Micro-Course designed to make it easy for people like you to get started with testing. Feel free to check that out and let me know what you think.
Smaller business logic frameworks would be mutations and ActiveInteraction.
They would replace the operations (and parts of reform) of TB.
Personally, I wouldn't use either of them over TB, they still add complexity, but don't offer too much over self-written stuff. YMMV of course.
If you want to start simple: create POROs for your "operations" with 2 public methods - initialize and run (or call, execute, apply, process etc.). Put your logic in them, create / execute them in your controllers.
Call them services, workflows, procedures, operations, scenarios, whatever.
try to put no persistent state in them - let them do their thing, return some sort of result (
true
/false
, model / nil, small result object).This fulfills a number of your criteria: it shouldn't slow you down much at all, it's simple, fairly maintainable and easily unit testable.
If you would like to research a different approach, look into DDD. The Arkency book should make for a good start, with the original DDD book giving quite a bit more background information.
> I'm not coding SPAs, so I still need awesome logic for Views / Presenters.
If you liked the Cells from TB, you can use them without using the rest of TB.
If you want something simpler, use a decorator like draper with ERB or Slim.
I don't know if there is a rails for node developers but they definitely come from two different perspectives on application development. Having written apps in both ecosystems I can say you'll be hard pressed to write an app faster with any framework other than rails, that being said it is convention over configuration and you need to do things the rails way to get results. If your looking for a starting place, there is a book called Agile Web Development with Rails 4 ( link: http://www.amazon.com/gp/product/1937785564 ). Its written in part by one of the inventors of the framework and is definitely worth the read. If your more familiar with NoSql I'd also recommend checking out mongoid, its an ORM for MongoDB and RoR and its pretty robust.
EDIT: While ruby and javascript have similar syntax ( if you can look past the curly braces and semi-colons ), learning about using ruby before starting with rails will be very helpful. Ruby is a wonderful language with a relatively easy learning curve but it does have its own idoms and caveats that are unique to it.
That article is specifically about legacy apps, and as such the good examples can be a little out of date. For instance:
class User < ActiveRecord::Base
scope :active, -> { where(active: true) }
scope :by_last_login_at, -> { order(:last_login_at) }
end
would just be:
class User < ActiveRecord::Base
def self.active
where(active: true)
end
def self.by_last_login_at
order(:last_login_at)
end
end
in a more modern codebase. Also, I think it's perfectly fine to use sql outside of models when you've extracted a bit of functionality into a service object. I think the nuance here might be articulated as "don't use sql in controllers, views, or other places it doesn't belong."
I agree with most of it, especially "extracting rake tasks to classes". If you're in the habit of extracting service objects to define interactions between things, you can frequently use these to make writing rake tasks easier, too and vice-versa.
Random things:
We created Hound as a hosted style checker, and I'm pretty fond of our guides.
I've worked on projects where we ran rubocop as part of a default
rake
. Took some care and feeding but it was handy.You might also check out
bundle-audit
andbrakeman
.Codeclimate does some very clever static analysis to find issues too, very worth it.
If you're looking for info about design patterns, I love Design Patterns in Ruby.
I advise you to learn ruby first, it will be good for your understanding, rails is a huge framework that helps the developer a lot, but on my opinion, know Ruby is a key for pretty understanding Rails.
I usually recommend eloquent ruby: https://www.amazon.com/Eloquent-Ruby-Addison-Wesley-Professional/dp/0321584104
But the are a lot of good books.
Some free content:
https://launchschool.com/books
https://www.ossblog.org/study-ruby-programming-with-open-source-books/
Some Udemy courses are good too.
I don't think you need it explained from a Rails point of view. Ruby is an OO language, and Rails simply exploits that.
You need to learn proper design patterns in Ruby (which apply to most OO languages). Sandi Metz's Practical Object-Oriented Design in Ruby is pretty much the gold standard for Ruby and very readable.
It's based heavily off of Martin's Agile Software Development, Principles, Patterns, and Practices.
After that, you can look into SOLID but, in Ruby-land, I think the single responsibility principal coupled with the rules laid out in Metz's book (summarized here) is a good place to start.
Also, it's worth noting that if you have good test coverage it makes re-factoring much, much easier.
Good luck!
The best thing for you are old books from that time. And they're cheap.
You're just looking for books that are in the Rails 2.x range, as it'll be hard to be specific to 2.1, but Rails release notes will help you bridge the gap between specific point releases.
The third edition of Agile Web Development With Rails and the first edition of The Rails Way are both Rails 2.x books.
Here's also an old online Rails 2.1 tutorial to help you in the meantime, but don't try to just get by on the few old web tutorials that are still online. Order books today. They're much deeper and broader than a web tutorial and they'll be invaluable if you're going to be working on this project for any real period of time.
EDIT: Michael Hartl's fantastic railstutorial.org has the "pre-1st edition" version of his book, which covers Rails 2.3, still available for free PDF download. Definitely grab that.
Extract properties into a class, so if you have a class like
User
and it has a series of address properties, create anAddress
class and extract those properties out into your new class and make sure itbelongs_to :user
. Then, if other types of classes need something similar (such as aBilling
object), you can use the same class and have that belong to that object as well.As far as naming, feel free to use whatever you want, though it might be best to use
province
instead ofstate
since the word "state" in programming means something different, not to mention a province generally covers that same kind of location as a US state does (in fact I'm pretty sure under the hood Google Maps API handles it this way as well). Also make sure you store zip codes as a string since many countries use letters in their zips and US zip codes use a dash to include localized neighborhoods or PO boxes.I'd pick up a book like Refactoring (Ruby ed.) which covers this pattern and a whole lot more.
This. The tests and charity model look good, but the website controller has too much logic and is tricky to follow. Beginning on line 9, there are 4 nested ifs / unless, which could be improved.
This would be something that should be refactored into a number of smaller methods inside a model like
models/donation.rb
or something alone those lines.I highly recommend Practical OO Design in Ruby by Sandi Metz. Her talks and writing are excellent and approachable and can applied in a number of contexts.
How well do you know Java? I suspect you may be overestimating the time to it will take you to get comfortable in Ruby. Learning your first language is always harder than the second, because you're really learning two separate things: 1) how to program, and 2) the language syntax. The second time around, it's largely just a new syntax. Most of your knowledge of how to code will transfer. True, Ruby will introduce you to new concepts, but I think you'll find them rather more like new superpowers than like new obstacles.
Specific recommendations:
For Ruby, I like the book Eloquent Ruby
For Rails, I like Michael Hartl's Rails Tutorial
For fun and practice, look at Ruby Koans
I second the comment to learn SQL really well. Also regular expressions come up frequently enough to be worth learning a bit about. Some familiarity with data structures is worth picking up, and getting a grasp on some common design patterns is well worth the time.
On the last point, I’d recommend Design Patterns in Ruby and Refactoring Ruby
Hope that helps.
can't go wrong with the RSpec book as a great starting point. great intro to cucumber too.
xUnit Test Patterns: Refactoring Test Code is a good read as well, though slightly more academic. a good substitute if you don't have the time is writing a shit load of tests and fully understanding what your assertions do.
also, stop testing the framework. nothing screams "amateur hour" like this:
describe Message do
it { should respond_to(:name) }
it { should respond_to(:email) }
it { should respond_to(:body) }
it { should respond_to(:phone) }
it { should respond_to(:subject) }
it { should respond_to(:sweet_honey) }
end
My book series Learn Ruby on Rails is aimed at beginners, with background and explanations that are missing from other books on Rails. See the good reviews on Amazon but you can get Book One for free on my website or free from Leanpub or Softcover or Google Play. Maybe someone else will comment if they've read it.
Hi there, I recommend this book: Rails 4 Test Prescriptions. https://www.amazon.com/Rails-Test-Prescriptions-Healthy-Codebase/dp/1941222196 It is the best book on testing I've ever read. In my experience, understanding how to write tests was not difficult. It was getting into the habit of testing, and understanding when to write tests and when not to that was a challenging art form. Hope this helps.
I really enjoyed the book The Rails 5 Way.
https://www.amazon.com/gp/product/B077D9X5NM/ref=dbs_a_def_rwt_hsch_vapi_taft_p1_i0
https://gorails.com/ is a great source as well
+1 for devops. Anyone looking for a reference manual for Linux should check out Mark Sobell's books. Really useful and doesn't become obsolete after a year (or even 10 years!). Just got his 3rd edition Linux manual for Christmas and I'm ecstatic.
Thanks for the advice. I don't really think Google is in my reach as a non-CS degree student, and I feel like I'd enjoy working in a startup/smaller company environment regardless. I'm thinking about going through Sedgewick's Algorithms 4th ed. book. It gives a high-level overview but also provides Java code as examples of implementation. I'll then try to adapt said Java into Ruby and tackle the exercise problems in Ruby as well. Does that sound like a solid plan to you?
To go further with Rails, it's a good idea to go further with Ruby. Some of my favorites:
Rails AntiPatterns
Metaprogramming Ruby
Practical Object-Oriented Design in Ruby
Everyday Rails Testing with RSpec
The Working Effectively with Legacy Code book is fantastic for bringing legacy code under test and then being able to refactor from there without breaking functionality.
Around 80-90% of the examples in the book can apply to ruby based projects with the remainder being C/C++ or other language specific problems (header files, being an example).
Just as important as the techniques explained in the book is the philosophy it espouses of bringing the code under test.
This and Eloquent Ruby. Best Ruby books.
Rails Antipatterns by Chad Pytel and Tammer Saleh:
http://www.amazon.com/Rails-AntiPatterns-Refactoring-Addison-Wesley-Professional/dp/0321604814
It's a little bit outdated, as it was written for Rails 3, but there's a lot of good stuff in that book.
Free in the UK! http://www.amazon.co.uk/dp/B00E25KVLW/ref=cm_sw_su_dp
It's also free on amazon.ca.
Try Metaprogramming Ruby 2 -- tons of advanced technique with real-world examples from current gems. It will expand the way you think about Ruby and give you design ideas for your Rails projects: https://www.amazon.com/Metaprogramming-Ruby-Program-Like-Facets/dp/1941222129/ref=dp_ob_title_bk
I've enjoyed the xUnit test patterns book. It's all about fundamentals that span languages and frameworks.
http://www.amazon.com/gp/aw/d/0131495054
I enjoyed this one: http://www.amazon.com/Refactoring-Edition-Addison-Wesley-Professional-Series/dp/0321984137 and http://www.amazon.com/Eloquent-Ruby-Addison-Wesley-Professional-Series/dp/0321584104/ref=pd_bxgy_b_text_z
Do you know: Growing Object-Oriented Software, Guided by Tests?
It's main language is Java. But, the technics can be easily applied to Ruby environment.
https://www.amazon.com/dp/0321503627
My favorite is the book design patterns in ruby
Personal favorites:
Crafting Rails Applications by core team member Jose Valim - http://plataformatec.com.br/crafting-rails-applications
Rails Anti-Patterns - http://www.amazon.com/Rails-AntiPatterns-Refactoring-Addison-Wesley-Professional/dp/0321604814
Well I've designed countless systems just like you did, then I wised up. You will too one day, just probably not very soon =)
You are building abstractions for the sake of having them. I won't offer you any pointers or counter arguments anymore, read this, then review your code:
http://www.amazon.com/Practical-Object-Oriented-Design-Ruby-Addison-Wesley/dp/0321721330
I felt the same way coming from a C++/Java background where I started with a blank text file and just started writing my program. Rails felt too magical and I wanted to know how it works! Well the answer is you need to get Agile Web Development or [The Rails 4 Way] (http://www.amazon.com/Rails-Edition-Addison-Wesley-Professional-Series/dp/0321944275) and just start reading. They explain how every single line of every single default file in a Rails project works.
You should pick up a used copy of The Rails 3 Way. It provides more in depth details about what certain things are. Sessions, etc. I keep a copy at my desk.
http://www.amazon.com/gp/offer-listing/0321944275/ref=dp_olp_used?ie=UTF8&amp;condition=used
March 6th: http://www.amazon.com/Ruby-Rails-Tutorial-Addison-Wesley-Professional/dp/0134077709/ref=sr_1_2?ie=UTF8&amp;qid=1416414278&amp;sr=8-2&amp;keywords=michael+hartl
But if you want a decent Rails4 book try this one:
https://pragprog.com/book/rails4/agile-web-development-with-rails-4
Design Patterns in Ruby
I'm reading a book: metaprogramming in ruby. Learning a lot about how ruby and rails works. Take a look.
http://www.amazon.ca/Metaprogramming-Ruby-Program-Like-Pros/dp/1941222129/ref=dp_ob_title_bk
Also ruby under a microscope: https://www.nostarch.com/rum
Actually it's in USD, not BRL. As I said, it is not the amazon.com.br store I am looking, it is the amazon.com.
In the br store it's R$ 7.99 (link)
Two books that helped me get to another level were:
&#x200B;
I've learned a lot by reading Rails Anti-patterns. http://www.amazon.com/Rails-AntiPatterns-Refactoring-Addison-Wesley-Professional/dp/0321604814
I always see people jump into Rails before they get into Ruby. Or, worse, they think that Rails is a language.
The latter makes me barf. Specifically, the kid I interviewed who assured me that Rails was indeed a language.
http://learnxinyminutes.com/docs/ruby/ and then read POODR http://www.amazon.com/Practical-Object-Oriented-Design-Ruby-Addison-Wesley/dp/0321721330
Then you should jump into Rails.