Merge pull request #817 from microweb10/friendly_urls

Friendly urls
This commit is contained in:
Raimond Garcia
2016-03-02 17:51:00 +01:00
10 changed files with 107 additions and 0 deletions

View File

@@ -11,6 +11,11 @@ class Management::ProposalsController < Management::BaseController
has_orders %w{confidence_score hot_score created_at most_commented random}, only: [:index, :print]
has_orders %w{most_voted newest}, only: :show
def show
super
redirect_to management_proposal_path(@proposal), status: :moved_permanently if request.path != management_proposal_path(@proposal)
end
def vote
@proposal.register_vote(current_user, 'yes')
set_proposal_votes(@proposal)