diff --git a/app/controllers/reviews_controller.rb b/app/controllers/reviews_controller.rb index de8c741..9ce8d00 100644 --- a/app/controllers/reviews_controller.rb +++ b/app/controllers/reviews_controller.rb @@ -1,8 +1,7 @@ class ReviewsController < ApplicationController helper Spree::BaseHelper - before_filter :login_required # no reviews without login first + before_filter :require_user_account # no reviews without login first - # def submit @review = Review.new :product_id => params[:id] @product = Product.find_by_id params[:id] @@ -12,7 +11,6 @@ def submit def create @review = Review.new :product_id => params[:id] @product = Product.find_by_id params[:review][:product_id] - if @review.update_attributes(params[:review]) if @product.rating.nil? @@ -26,4 +24,11 @@ def create end end + private + def require_user_account + return if logged_in? + store_location + redirect_to signup_path + end + end