# What Advice Would You Give A Rails Newbie?

**URL:** <https://www.ruby-forum.com/t/what-advice-would-you-give-a-rails-newbie/192895>\
**Category:** Rails\
**Created:** [August 7, 2010, 9:39pm UTC](https://www.ruby-forum.com/t/what-advice-would-you-give-a-rails-newbie/192895 "2010-08-07T21:39:09Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![xagyg](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/x/958977/32.png) [@xagyg](https://www.ruby-forum.com/u/xagyg)\
**Post date:** [August 7, 2010, 9:39pm UTC](https://www.ruby-forum.com/t/what-advice-would-you-give-a-rails-newbie/192895/1 "2010-08-07T21:39:09Z")

</div>

I’m new to Ruby and to Rails, but have been very impressed by the  
tutorials I’ve gone through for each. They have convinced me that  
these are the best tools for the solutions I need to create, but  
before I really got started, I thought I’d query the wisdom of this  
list.

Note, I plan on starting with Ruby 1.9 and Rails 3.0.

Is there a better template engine than the default ERB? What do people  
suggest?

Is there an overview of best-practices when it comes to User  
management and account authorization and authentication? Is there a  
gem that I should look at that may implement some of this?

Are there other issues or best-practices that I should know about or  
gems that you would suggest I investigate?

Thanks,  
Brad

---

<div class="post-metadata">

**Author:** ![xagyg](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/x/958977/32.png) [@xagyg](https://www.ruby-forum.com/u/xagyg)\
**Post date:** [August 7, 2010, 10:09pm UTC](https://www.ruby-forum.com/t/what-advice-would-you-give-a-rails-newbie/192895/2 "2010-08-07T22:09:35Z")

</div>

On 7 August 2010 19:54, Brad L. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I’m new to Ruby and to Rails, but have been very impressed by the  
> tutorials I’ve gone through for each. They have convinced me that  
> these are the best tools for the solutions I need to create, but  
> before I really got started, I thought I’d query the wisdom of this  
> list.

Always good to hear someone excited about Rails!

One bit of ‘wisdom’: the out-of-the-box Rails defaults are very  
capable. We’ve all written substantial apps using bog-standard ERb and  
Test::Unit, so don’t feel pressured to use fashionable alternatives  
just because they’re fashionable. Of course, if you’re keen to learn  
and try out new stuff, then go for it, and use things that stick and  
make sense for you.

With that said…

> Is there a better template engine than the default ERB? What do people suggest?

For a less repetitive and more structured templating experience, Haml  
is pretty popular these days:

[http://haml-lang.com/](http://haml-lang.com/)

> Is there an overview of best-practices when it comes to User  
> management and account authorization and authentication? Is there a  
> gem that I should look at that may implement some of this?

The Rails Security Guide has a fairly good section on User Management:

> **[Securing Rails Applications — Ruby on Rails Guides](https://guides.rubyonrails.org/security.html#user-management)**
>
> Securing Rails ApplicationsThis manual describes common security problems in web applications and how to avoid them with Rails.After reading this guide, you will know: All countermeasures that are highlighted. The concept of sessions in Rails, what...

As for gems/plugins, I’ve lately seen a lot of projects using Authlogic:

> **[GitHub - binarylogic/authlogic: A simple ruby authentication solution.](https://github.com/binarylogic/authlogic)**
>
> A simple ruby authentication solution. Contribute to binarylogic/authlogic development by creating an account on GitHub.

It’s well designed and extensible, and you should be able to get up  
and running pretty quickly.

It’s an instructive exercise to try writing a basic user auth system,  
though, even if it’s just once as a toy project. You just need methods  
in the User to hash their password (with a salt, of course), and to  
look up a user based on a supplied username and password. And then  
some convenience methods in the controller to store the logged-in user  
in the session object. It’s good to have an understanding of how the  
basic pieces fit together, so that the gem you end up using isn’t just  
a piece of ‘magic’.

> Are there other issues or best-practices that I should know about or  
> gems that you would suggest I investigate?

You might want to explore RSpec as an alternative test (sorry,  
behaviour) framework – it’s very popular, and provides a new  
perspective on testing. Again, not required; just interesting.

Chris

---

<div class="post-metadata">

**Author:** ![xagyg](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/x/958977/32.png) [@xagyg](https://www.ruby-forum.com/u/xagyg)\
**Post date:** [August 8, 2010, 1:31pm UTC](https://www.ruby-forum.com/t/what-advice-would-you-give-a-rails-newbie/192895/3 "2010-08-08T13:31:25Z")

</div>

Here are some other resources you might want to look into:

# see what gems/tools other uses

- [http://ruby-toolbox.com/](http://ruby-toolbox.com/)

# various screencasts

- [http://railscasts.com/](http://railscasts.com/)
- [http://rubytu.be/](http://rubytu.be/)
- [http://teachmetocode.com/screencasts/](http://teachmetocode.com/screencasts/)
- [http://www.rubypulse.com/](http://www.rubypulse.com/)

# other

- [http://rails-bestpractices.com](http://rails-bestpractices.com)
- [http://edgeguides.rubyonrails.org/](http://edgeguides.rubyonrails.org/)

Enjoy 🙂

–  
gudleik

---

<div class="post-metadata">

**Author:** ![xagyg](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/x/958977/32.png) [@xagyg](https://www.ruby-forum.com/u/xagyg)\
**Post date:** [August 8, 2010, 4:53pm UTC](https://www.ruby-forum.com/t/what-advice-would-you-give-a-rails-newbie/192895/4 "2010-08-08T16:53:21Z")

</div>

Great stuff so far. Thanks Chris & Gudleik!

Brad

---

<div class="post-metadata">

**Author:** ![xagyg](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/x/958977/32.png) [@xagyg](https://www.ruby-forum.com/u/xagyg)\
**Post date:** [August 10, 2010, 3:36am UTC](https://www.ruby-forum.com/t/what-advice-would-you-give-a-rails-newbie/192895/5 "2010-08-10T03:36:48Z")

</div>

I found a couple of good books, Simply Rails 2 by Lenz is my favorite.  
Of course it’s for Rails 2. You may have to wait for a while for the  
new crop of Rails 3 books to come out. Or try to update the examples  
to work in Rails 3.

Judging by your questions about template engines and user management,  
I’d recommend a more advanced book like The Rails Way.

Other than that, try to build your own app. Nothing really works  
better than that.

---

<div class="post-metadata">

**Author:** ![xagyg](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/x/958977/32.png) [@xagyg](https://www.ruby-forum.com/u/xagyg)\
**Post date:** [August 9, 2010, 4:14pm UTC](https://www.ruby-forum.com/t/what-advice-would-you-give-a-rails-newbie/192895/6 "2010-08-09T16:14:28Z")

</div>

Chris M. wrote:

> On 7 August 2010 19:54, Brad L. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > I’m new to Ruby and to Rails, but have been very impressed by the  
> > tutorials I’ve gone through for each. They have convinced me that  
> > these are the best tools for the solutions I need to create, but  
> > before I really got started, I thought I’d query the wisdom of this  
> > list.
> 
> Always good to hear someone excited about Rails!
> 
> One bit of ‘wisdom’: the out-of-the-box Rails defaults are very  
> capable. We’ve all written substantial apps using bog-standard ERb and  
> Test::Unit, so don’t feel pressured to use fashionable alternatives  
> just because they’re fashionable.

At the same time, don’t get wedded to the defaults just because they’re  
the defaults. I hope I never again have to use Rails’ standard test  
framework for new development – the Test::Unit API is crap, and  
fixtures are somewhere between moronic and dangerous. The Rails team  
broke some great new ground with the testing framework, but like all  
pioneers, they made some big mistakes.

## Best,

Marnen Laibow-Koser  
[http://www.marnen.org](http://www.marnen.org)  
removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![xagyg](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/x/958977/32.png) [@xagyg](https://www.ruby-forum.com/u/xagyg)\
**Post date:** [August 13, 2010, 9:06pm UTC](https://www.ruby-forum.com/t/what-advice-would-you-give-a-rails-newbie/192895/7 "2010-08-13T21:06:51Z")

</div>

On Mon, Aug 9, 2010 at 8:35 PM, Agoofin [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I found a couple of good books, Simply Rails 2 by Lenz is my favorite.

That was pleasing to me to know; I have a Books24x7 subscription, so I  
selected (the newest, I think) book on Rails from the selection  
available to me, which turned out to be Patrick Lenz’s Simply Rails 2.  
🙂

> Judging by your questions about template engines and user management,  
> I’d recommend a more advanced book like The Rails Way.

Would you say that “The Rails Way” would be a good follow up to Lenz’s  
book? I’m about 75% through it, so I should perhaps think about ‘what  
to do next’. 🙂

My thanks for Brad for great question; All sorts of useful information  
about resources in the responses.

Iain

---

<div class="post-metadata">

**Author:** ![xagyg](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/x/958977/32.png) [@xagyg](https://www.ruby-forum.com/u/xagyg)\
**Post date:** [August 13, 2010, 9:17pm UTC](https://www.ruby-forum.com/t/what-advice-would-you-give-a-rails-newbie/192895/8 "2010-08-13T21:17:24Z")

</div>

On 13 Aug 2010, at 21:05, Iain D. wrote:

> > Judging by your questions about template engines and user management,  
> > I’d recommend a more advanced book like The Rails Way.
> 
> Would you say that “The Rails Way” would be a good follow up to Lenz’s  
> book? I’m about 75% through it, so I should perhaps think about ‘what  
> to do next’. 🙂

The Rails Way is a really nice read, go ahead. You could also look  
into the RSpec book from Pragmatic Programmers. It’s very good.

Best regards

Peter De Berdt

---

<div class="post-metadata">

**Author:** ![xagyg](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/x/958977/32.png) [@xagyg](https://www.ruby-forum.com/u/xagyg)\
**Post date:** [August 13, 2010, 10:30pm UTC](https://www.ruby-forum.com/t/what-advice-would-you-give-a-rails-newbie/192895/9 "2010-08-13T22:30:01Z")

</div>

On Aug 13, 3:16 pm, Peter De Berdt [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> into the RSpec book from Pragmatic Programmers. It’s very good.
> 
> Best regards
> 
> Peter De Berdt

My first Rails projects were built ignoring the concept of automated  
tests. The result was a lot of manual checks and debugging whenever  
changes were required. If I could go back in time, and were just  
starting out with Rails, I wouldn’t make this mistake again. Getting  
a good grasp on something like RSpec early will provide you great  
benefits and save you much in the way of time and hair.

The RSpec book looks very promising.

Bob
