spree_reviews | Straightforward review/rating functionality | Machine Learning library
kandi X-RAY | spree_reviews Summary
kandi X-RAY | spree_reviews Summary
Straightforward review/rating functionality.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of spree_reviews
spree_reviews Key Features
spree_reviews Examples and Code Snippets
Community Discussions
Trending Discussions on spree_reviews
QUESTION
I am trying to do a search in the spree backend in reviews listing page.
But am getting undefined method error for the fields. Eg: undefined method title_cont' , undefined method
review _cont'.
Hereby am posting my controller:
reviews_controller.rb
...ANSWER
Answered 2017-Dec-05 at 09:40@cliffs - To be able to search by using ransack gem, you will first have to whitelist all those fields on which you wanna perform the search. So in your review.rb
model add the following line if you are inheriting it from Spree::Base
-
self.whitelisted_ransackable_attributes = %w[title, review]
else if you are inheriting it from ActiveRecord::Base
you have to define ransackable_attributes
as a class method
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install spree_reviews
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page