Changes routes to use budgets resource instead of namespace
This commit is contained in:
@@ -7,7 +7,7 @@ module BudgetHelper
|
||||
def namespaced_budget_investment_path(investment, options={})
|
||||
case namespace
|
||||
when "management::budgets"
|
||||
management_budgets_investment_path(investment, options)
|
||||
management_budget_investment_path(investment, options)
|
||||
else
|
||||
budget_investment_path(investment, options.merge(budget_id: investment.budget_id))
|
||||
end
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<main>
|
||||
<span class="not-print">
|
||||
<%= render 'admin/shared/budget_investment_search', url: management_budgets_investments_path %>
|
||||
<%= render 'admin/shared/budget_investment_search', url: management_budget_investments_path %>
|
||||
</span>
|
||||
|
||||
<div class="wrap row">
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<div class="small-12 medium-9 column end">
|
||||
<h1 class=""><%= t("management.budget_investments.create") %></h1>
|
||||
|
||||
<%= form_for(@investment, url: management_budgets_investments_path, method: :post) do |f| %>
|
||||
<%= form_for(@investment, url: management_budget_investments_path(@budget), method: :post) do |f| %>
|
||||
<%= render 'shared/errors', resource: @investment %>
|
||||
|
||||
<div class="row">
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<div id="budget-investments" class="budget-investments-list small-12 column">
|
||||
|
||||
<div class="not-print">
|
||||
<%= form_tag print_management_budgets_investments_path, method: :get, enforce_utf8: false do %>
|
||||
<%= form_tag print_management_budget_investments_path, method: :get, enforce_utf8: false do %>
|
||||
<div class="small-12 medium-4 column float-left">
|
||||
<%= select_tag :geozone,
|
||||
options_for_select(geozone_select_options.unshift([t("geozones.none"), "all"]), params[:geozone]),
|
||||
|
||||
@@ -286,8 +286,13 @@ Rails.application.routes.draw do
|
||||
get :print, on: :collection
|
||||
end
|
||||
|
||||
namespace :budgets do
|
||||
resources :investments, only: [:index, :new, :create, :show] do
|
||||
resources :budgets, only: :index do
|
||||
collection do
|
||||
get :create_investments
|
||||
get :support_investments
|
||||
get :print_investments
|
||||
end
|
||||
resources :investments, only: [:index, :new, :create, :show], controller: 'budgets/investments' do
|
||||
post :vote, on: :member
|
||||
get :print, on: :collection
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user