Files
nairobi/app/helpers/guides_helper.rb
Bertocq dbe723079e Disable guide page when Budget is not accepting
Why:

When there is not Budget accepting (Investment creation) the guide page
doesn't have much sense as it will give the user an option that can't be
used (creating an Investment).

How:

Using `Budget.current&.accepting?` conditional at GuidesHelper to link
to new proposal link instead of guide page, and adding an scenario to
guides feature spec for it.
2018-02-26 10:01:30 +01:00

20 lines
329 B
Ruby

module GuidesHelper
def new_proposal_guide
if feature?('guides') && Budget.current&.accepting?
new_guide_path
else
new_proposal_path
end
end
def new_budget_investment_guide
if feature?('guides')
new_guide_path
else
new_budget_investment_path(current_budget)
end
end
end