Sha256: c41c3dd4599bbbe12c22709a97e54ccb97a551afcf15f0ddfa87b96bd4fad346
Contents?: true
Size: 814 Bytes
Versions: 7
Compression:
Stored size: 814 Bytes
Contents
class MainController < Volt::ModelController model :page def flash_notice flash._notices << 'A notice message' end def flash_success flash._successes << 'A success message' end def flash_warning flash._warnings << 'A warning message' end def flash_error flash._errors << 'An error message' end def cookie_test self.model = page._new_cookie.buffer end def add_cookie cookies.send(:"_#{_name.to_s}=", _value) self.model = page._new_cookie.buffer end private # the main template contains a #template binding that shows another # template. This is the path to that template. It may change based # on the params._controller and params._action values. def main_path params._controller.or('main') + '/' + params._action.or('index') end end
Version data entries
7 entries across 7 versions & 1 rubygems