Add new Proposal share endpoint, plus ability for ereryone to use it

This commit is contained in:
Bertocq
2017-05-30 15:39:47 +02:00
parent 10356f931d
commit b2c79174aa
3 changed files with 5 additions and 1 deletions

View File

@@ -45,6 +45,9 @@ class ProposalsController < ApplicationController
def retire_form
end
def share
end
def vote_featured
@proposal.register_vote(current_user, 'yes')
set_featured_proposal_votes(@proposal)

View File

@@ -4,7 +4,7 @@ module Abilities
def initialize(user)
can [:read, :map], Debate
can [:read, :map, :summary], Proposal
can [:read, :map, :summary, :share], Proposal
can :read, Comment
can :read, Poll
can :read, Poll::Question

View File

@@ -52,6 +52,7 @@ Rails.application.routes.draw do
put :flag
put :unflag
get :retire_form
get :share
patch :retire
end
collection do