Commit 42c95162d35f27716d41379d4a2adbd899e50a35

Authored by Rodrigo Souto
Committed by Daniela Feitosa
1 parent 2f91c5c8

Controller and fixes

* Feature:
    - Adding session to plugin context
  * Fixes:
    - Fixing routes due to dubious route
    - Including helper due to method float_to_currency

(ActionItem1996)
config/routes.rb
... ... @@ -79,7 +79,7 @@ ActionController::Routing::Routes.draw do |map|
79 79 map.profile_search 'profile/:profile/search', :controller => 'profile_search', :action => 'index', :profile => /#{Noosfero.identifier_format}/
80 80  
81 81 # public profile information
82   - map.profile 'profile/:profile/:action/:id', :controller => 'profile', :action => 'index', :id => /.*/, :profile => /#{Noosfero.identifier_format}/
  82 + map.profile 'profile/:profile/:action/:id', :controller => 'profile', :action => 'index', :id => /[^\/]*/, :profile => /#{Noosfero.identifier_format}/
83 83  
84 84 # contact
85 85 map.contact 'contact/:profile/:action/:id', :controller => 'contact', :action => 'index', :id => /.*/, :profile => /#{Noosfero.identifier_format}/
... ...
lib/noosfero/plugin.rb
1 1 require 'noosfero'
  2 +include ActionView::Helpers::AssetTagHelper
  3 +
2 4 class Noosfero::Plugin
3 5  
4 6 attr_accessor :context
... ...
lib/noosfero/plugin/context.rb
... ... @@ -26,4 +26,8 @@ class Noosfero::Plugin::Context
26 26 @params ||= @controller.send(:params)
27 27 end
28 28  
  29 + def session
  30 + @session ||= @controller.send(:session)
  31 + end
  32 +
29 33 end
... ...