On 7 August 2010 19:54, Brad L. [email protected] 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
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:
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:
As for gems/plugins, I’ve lately seen a lot of projects using Authlogic:
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.