Commit a66293bb00c88ab018277405d057c6895d67f186
Exists in
master
and in
29 other branches
Merge branch 'ai2938' of https://gitlab.com/brauliobo/noosfero into brauliobo/noosfero-ai2938
Showing
1 changed file
with
4 additions
and
3 deletions
Show diff stats
lib/noosfero/plugin/routes.rb
... | ... | @@ -15,12 +15,13 @@ Dir.glob(File.join(Rails.root, plugins_root, '*', 'controllers')) do |controller |
15 | 15 | controllers_by_folder.each do |folder, controllers| |
16 | 16 | controllers.each do |controller| |
17 | 17 | controller_name = controller.gsub("#{plugin_name}_plugin_",'') |
18 | - map.connect "#{prefixes_by_folder[folder]}/#{plugin_name}/#{controller_name}/:action/:id", :controller => controller | |
18 | + map.connect "#{prefixes_by_folder[folder]}/#{plugin_name}/#{controller_name}/:action/:id", :controller => controller, | |
19 | + :profile => (if %w[profile myprofile].include?(folder) then /#{Noosfero.identifier_format}/ else nil end) | |
19 | 20 | end |
20 | 21 | end |
21 | 22 | |
22 | 23 | map.connect 'plugin/' + plugin_name + '/:action/:id', :controller => plugin_name + '_plugin' |
23 | - map.connect 'profile/:profile/plugin/' + plugin_name + '/:action/:id', :controller => plugin_name + '_plugin_profile' | |
24 | - map.connect 'myprofile/:profile/plugin/' + plugin_name + '/:action/:id', :controller => plugin_name + '_plugin_myprofile' | |
24 | + map.connect 'profile/:profile/plugin/' + plugin_name + '/:action/:id', :controller => plugin_name + '_plugin_profile', :profile => /#{Noosfero.identifier_format}/ | |
25 | + map.connect 'myprofile/:profile/plugin/' + plugin_name + '/:action/:id', :controller => plugin_name + '_plugin_myprofile', :profile => /#{Noosfero.identifier_format}/ | |
25 | 26 | map.connect 'admin/plugin/' + plugin_name + '/:action/:id', :controller => plugin_name + '_plugin_admin' |
26 | 27 | end | ... | ... |