Class: AnyClass

Inherits:
Object
  • Object
show all
Includes:
RenderAnywhere
Defined in:
lib/simple_javascript_testing.rb

Defined Under Namespace

Classes: RenderingController

Class Attribute Summary collapse

Instance Method Summary collapse

Class Attribute Details

.prefixObject

Returns the value of attribute prefix.



9
10
11
# File 'lib/simple_javascript_testing.rb', line 9

def prefix
  @prefix
end

Instance Method Details

#build_html(template) ⇒ Object



12
13
14
15
16
# File 'lib/simple_javascript_testing.rb', line 12

def build_html(template)
  html = render :template => template,
                :layout => 'application'
  html
end

#include_helper(helper_name) ⇒ Object

Include an additional helper If being used in a rake task, you may need to require the file(s) Ex: require Rails.root.join(‘app’, ‘helpers’, ‘blog_pages_helper’)



20
21
22
# File 'lib/simple_javascript_testing.rb', line 20

def include_helper(helper_name)
  set_render_anywhere_helpers(helper_name)
end

#set_instance_variable_to(var, value) ⇒ Object

Apply an instance variable to the controller If you need to use instance variables instead of locals, just call this method as many times as you need.



26
27
28
# File 'lib/simple_javascript_testing.rb', line 26

def set_instance_variable_to(var, value)
  set_instance_variable(var, value)
end