Class: FeedbackReviewsController

Inherits:
Spree::BaseController
  • Object
show all
Defined in:
app/controllers/feedback_reviews_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



3
4
5
6
7
8
9
10
11
12
13
14
15
# File 'app/controllers/feedback_reviews_controller.rb', line 3

def create
  params[:feedback_review][:rating].sub!(/\s*stars/,'') unless params[:feedback_review][:rating].blank?

  @review = Review.find_by_id(params[:review_id])
  @review &&
    (@feedback_review = @review.feedback_reviews.new(params[:feedback_review])) && @feedback_review.save

  respond_to do |format|
    format.html { redirect_to :back  }
    format.js   { render :action => :create }
  end

end