Commit 99109e360945f6528e28b3de41f14250bf630d63
1 parent
04a44f68
Exists in
master
and in
29 other branches
Only put profile format on profile controllers
Showing
1 changed file
with
2 additions
and
1 deletions
Show diff stats
lib/noosfero/plugin/routes.rb
... | ... | @@ -15,7 +15,8 @@ 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, :profile => /#{Noosfero.identifier_format}/ | |
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 | ... | ... |