Module: Neutral::VotesHelper
- Defined in:
- app/helpers/neutral/votes_helper.rb
Instance Method Summary collapse
- #by_url ⇒ Object
- #vote_path(value = [1,0].sample) ⇒ Object
- #votes_path(value = [1,0].sample) ⇒ Object
Instance Method Details
#by_url ⇒ Object
3 4 5 |
# File 'app/helpers/neutral/votes_helper.rb', line 3 def by_url return raw "a[href*='#{request.post? ? votes_path : vote_path}']" end |
#vote_path(value = [1,0].sample) ⇒ Object
7 8 9 |
# File 'app/helpers/neutral/votes_helper.rb', line 7 def vote_path(value=[1,0].sample) raw neutral.vote_path(vote, value: value) end |
#votes_path(value = [1,0].sample) ⇒ Object
11 12 13 |
# File 'app/helpers/neutral/votes_helper.rb', line 11 def votes_path(value=[1,0].sample) raw neutral.votes_path(vote: vote.main_attributes.update(value: value)) end |