Closed ElvinEfendi closed 10 years ago
Hi, can you say me please, how can I set readonly option for specific rating_for field and make that user can rate only ones?
Hi, @yozzz. If you are using my fork you can do it as follow: rating_for @your_object, "dimension", {disable_after_rate: false}
Sorry for question... you have two main folders generators and letsrate. From generators/letsrate/templates I copied two files as letsrate.js.coffee.erb and rater_controller.rb. In main folder letsrate you have files as helpers.rb, model.rb and version.rb , where I should put it with file letsrate.rb that requires them? After installing gem I don't see similar files. Thank you for understanding! :)
@yozzz you do not need to copy any file. Just install the gem as follow and use the helper in a way I mentioned above: gem 'letsrate', git: "https://github.com/ElvinEfendi/letsrate.git"
Thought I can't install gem from fork repository, thanks. After command rails g letsrate user getting: /home/yoz/.rvm/gems/ruby-1.9.3-p448/gems/activesupport-3.2.13/lib/active_support/depend encies.rb:251:in `require': /home/yoz/.rvm/gems/ruby-1.9.3-p448/bundler/gems/letsrate-b ce8544a4d49/lib/letsrate/model.rb:62: syntax error, unexpected tLABEL (SyntaxError) def letsrate_rateable(*dimensions, allow_rerating: false)
@yozzz The changes I made mistakenly was only Ruby 2.0 compatible - I had used keyword arguments. I've just corrected it and now it should work with Ruby 1.9.* as well. You can reinstall and check it again.
I will try it thank you! Is there some way in this gem output stars that start count from one, I mean first star active by default?
Hi .. For a long time, I have not enough time to mange this gem. But nowadays I'm available. You can check this issue 2-3 days later. Thanks ...
@ElvinEfendi In your generator file you have copy_file 'letsrate.js.cofee.erb', 'app/assets/javascripts/letsrate.js.coffee.erb'. Coffee is mispelled, causing issues.
@ericaBradford it seems like the issues I've targeted with this pull requests are already fixed without merging anyway.
@ElvinEfendi How do we change data-disable-after-rate? I can't seem to find how to fix it...
@ericaBradford when calling rating_for or rating_for_user method just set disable_after_rate: true
check the helper methods' implementation for more info: https://github.com/muratguzel/letsrate/blob/master/lib/letsrate/helpers.rb
@ElvinEfendi Thank you!!!
@ElvinEfendi I don't know why, but it isn't working... <%= rating_for @recipe, "Rating", :disable_after_rate => false %> Am I doing something wrong? I'm trying to make recipes reratable, so I'm pretty sure it's supposed to be set false
Fixed bugs:
Rerating functionality: Now developers can toggle between allowing rerating and no allowing but sending flag while calling letsrate_rateable method
Added documentation for using allow_rerating flag