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
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:
http://guides.rubyonrails.org/security.html#user-management
As for gems/plugins, I've lately seen a lot of projects using Authlogic:
http://github.com/binarylogic/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.
Chris
# see what gems/tools other uses
* http://ruby-toolbox.com/
# various screencasts
* http://railscasts.com/
* http://rubytu.be/
* http://teachmetocode.com/screencasts/
* http://www.rubypulse.com/
# other
* http://rails-bestpractices.com
* http://edgeguides.rubyonrails.org/
Enjoy :)
--
gudleik
Brad
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
mar...@marnen.org
--
Posted via http://www.ruby-forum.com/.
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
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'. :)
Best regards
Peter De Berdt