![]() |
# Module: BivouacHelpers::BaseView [ "README", "AUTHORS", "COPYING", "lib/bivouac/helpers/view/goh/base.rb", "lib/bivouac/helpers/view/goh/form.rb", "lib/bivouac/helpers/view/goh/html.rb", "lib/bivouac/helpers/view/goh/sound.rb", "lib/bivouac/helpers/view/goh/scriptaculous.rb", "lib/bivouac/helpers/view/goh/javascript.rb", nil].each do JavaScriptGenerator.view_html BivouacHelpers.view_html BivouacHelpers::SoundView.view_html BivouacHelpers::ScriptAculoUsView.view_html BivouacHelpers::BaseView.view_html BivouacHelpers::JavaScriptView.view_html BivouacHelpers::HtmlView.view_html BivouacHelpers::FormView.view_html end |
bivouac/helpers/view/html

Alias for render

Return the content of a public file as string
public_to_str( "/stylesheets/autocomplete.css" )
#=> "div.autocomplete {\n position:absolute;\n..."
[ show source ]
# File lib/bivouac/helpers/view/goh/base.rb, line 22
22: def public_to_str( file )
23: if file.include? ".."
24: return nil
25: end
26:
27: file = ENV['BIVOUAC_ROOT'] + "/public/" + file
28: open( file ) do |f|
29: data = f.read
30: end
31:
32: return data
33: end

render( :hello, :object => @my_object )
is equivalent to
@object = @my_object hello( )
[ show source ]
# File lib/bivouac/helpers/view/goh/base.rb, line 9
9: def render( partial, options = {} )
10: options.each do |k, v|
11: self.instance_variable_set( "@#{k.to_s}".to_sym, v )
12: end
13: self.send( partial.to_sym )
14: end