Q:

Review system with login / signup required

I'm writing a review system for items in Ruby on Rails. I want the process to be as follow: 

users to start entering their review/ratings
when they hit submit, if they're not logged in, users are redirected to the signup or login page, 
they create and account or signup
they're redirected to the post where they wrote a review, and the review is added.

How do I do that? 

A:

Some highlights

Use Authlogic

In your Review Controller, say something like before_filter :require_user_before_reviews
In require_user_before_reviews do something like 

/app/controllers/reviews_controller.rb
  def require_user_before_reviews
    return true if logged_in?
    session[:review_params] = params[:review]
    session[:return_url] = new_review_path
    redirect_to login_path
  end

Then re-render the form on new_review_path with the session value after logged in.
There's some broad strokes in there, but that should work.
As a note: as a User, I'd want you to ask me to login before I do the review.

