Sha256: a1bf98e33caadcd4e0ec61706b3fc9414a6172020a048604152d970e280df8c7
Contents?: true
Size: 835 Bytes
Versions: 16
Compression:
Stored size: 835 Bytes
Contents
# bivouac/helpers/view/base module BivouacHelpers module BaseView # render( :hello, :object => @my_object ) # is equivalent to # @object = @my_object # hello( ) def render( partial, options = {} ) options.each do |k, v| self.instance_variable_set( "@#{k.to_s}".to_sym, v ) end self.send( partial.to_sym ) end alias_method :partial, :render # Return the content of a public file as string # # public_to_str( "/stylesheets/autocomplete.css" ) # #=> "div.autocomplete {\n position:absolute;\n..." def public_to_str( file ) if file.include? ".." return nil end file = ENV['BIVOUAC_ROOT'] + "/public/" + file open( file ) do |f| data = f.read end return data end end end
Version data entries
16 entries across 16 versions & 1 rubygems