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.



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

def prefix
  @prefix
end

Instance Method Details

#build_html(template) ⇒ Object



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

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’)



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

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.



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

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