Better slugs for campaigns
This commit is contained in:
parent
79427774e5
commit
e1287683f5
1 changed files with 4 additions and 1 deletions
|
@ -160,7 +160,10 @@ class CampaignsController < ApplicationController
|
|||
|
||||
p2p_params = params.except(:nonprofit_id, :summary,:goal_amount)
|
||||
p2p_params.merge!(parent_campaign.child_params)
|
||||
p2p_params[:slug] = Format::Url.convert_to_slug "#{p2p_params[:name]}-#{profile.name}"
|
||||
|
||||
base_slug = Format::Url.convert_to_slug "#{p2p_params[:name]}-#{profile.name}"
|
||||
algo = SlugP2pCampaignNamingAlgorithm.new(p2p_params[:nonprofit_id])
|
||||
p2p_params[:slug] = algo.create_copy_name(base_slug)
|
||||
|
||||
campaign = Campaign.create(p2p_params)
|
||||
|
||||
|
|
Loading…
Reference in a new issue