RailsCasts Pro episodes are now free!

Learn more or hide this

Iain Hecker's Profile

GitHub User: iain

Site: http://iain.nl/

Comments by Iain Hecker

Avatar

+1 for testing (Jasmine, Evergreen perhaps?)

Avatar

You definitely could. Still, in my experience, whenever I try to go light-weight, I realize how much Rails does for you, without you even knowing it. Like ActiveRecord integration with all kinds of handy tasks, CSRF protection, the asset pipeline, a rich set of gems/plugins, hundreds of helpers in controllers and views, and so on. What I'm trying to say is: Sinatra and Node.js are awesome tools, but be sure to know what you're getting yourself into. :)

Avatar

I don't like coupling the name of the model to the name of the presenter. What if you have multiple ways of displaying users, or if you more than one user-like objects?

A simple solution might be something like:

<% present @admin, with: ProfilePresenter do |presenter| %>
   <p><%= presenter.website %></p>
<% end %>
Avatar

Once again, nice screencast!

However, I think you have too much logic inside te password_resets_controller. Especially the 2.hours part. Now for small apps this might not be a big problem, but otherwise, I would create something like a PasswordReset class in the model directory to handle this logic for me.

And I agree with @introspectif that Devise is childishly easy to customize. So much so that I would never write my own authentication. There are too many security pitfalls to remember.

Avatar

@/users/719 make sure you have the rspec gem in the development group, not just in the test group in your Gemfile.

Avatar

It's not a problem with Metrical, but with flog and Ruby 1.9 specific syntax.