Module: Caterpillar::Helpers::Portlet

Included in:
Liferay
Defined in:
lib/caterpillar/helpers/portlet.rb

Instance Method Summary collapse

Instance Method Details

#ajax_response(params = {}) ⇒ Object

Send the rendered page in a file to serveResource method



28
29
30
31
32
33
34
35
36
# File 'lib/caterpillar/helpers/portlet.rb', line 28

def ajax_response params = {}
  if params[:template]
    content = render_to_string :template => params[:template]
  else
    content = render_to_string
  end

  send_data resposta, :type => 'text/html', :filename => "content_#{request.session_options[:id]}.html"
end

#get_namespaceObject

Set instance variable @namespace



22
23
24
# File 'lib/caterpillar/helpers/portlet.rb', line 22

def get_namespace
  @namespace = namespace_cookie
end

Get portlet namespace from cookie set by rails-portlet



17
18
19
# File 'lib/caterpillar/helpers/portlet.rb', line 17

def namespace_cookie
  cookies[:Portlet_namespace]
end