Note we don't cast negative votes when users remove their support. That way we provide compatibility for institutions who have implemented real negative votes (in case there are / will be any), and we also keep the database meaningful: it's not that users downvoted something; they simply removed their upvote. Co-Authored-By: Javi Martín <javim@elretirao.net> Co-Authored-By: Julian Nicolas Herrero <microweb10@gmail.com>
29 lines
1.0 KiB
Ruby
29 lines
1.0 KiB
Ruby
resources :budgets, only: [:show, :index] do
|
|
resources :groups, controller: "budgets/groups", only: [:show]
|
|
resources :investments, controller: "budgets/investments" do
|
|
member do
|
|
put :flag
|
|
put :unflag
|
|
end
|
|
|
|
collection { get :suggest }
|
|
|
|
resources :votes, controller: "budgets/investments/votes", only: [:create, :destroy]
|
|
end
|
|
|
|
resource :ballot, only: :show, controller: "budgets/ballots" do
|
|
resources :lines, controller: "budgets/ballot/lines", only: [:create, :destroy]
|
|
end
|
|
|
|
resource :results, only: :show, controller: "budgets/results"
|
|
resource :stats, only: :show, controller: "budgets/stats"
|
|
resource :executions, only: :show, controller: "budgets/executions"
|
|
end
|
|
|
|
resolve "Budget::Investment" do |investment, options|
|
|
[investment.budget, :investment, options.merge(id: investment)]
|
|
end
|
|
|
|
get "investments/:id/json_data", action: :json_data, controller: "budgets/investments"
|
|
get "/budgets/:budget_id/investments/:id/json_data", action: :json_data, controller: "budgets/investments"
|