Skip to content

Instantly share code, notes, and snippets.

@apotonick
Created August 20, 2010 11:38
Show Gist options
  • Save apotonick/540125 to your computer and use it in GitHub Desktop.
Save apotonick/540125 to your computer and use it in GitHub Desktop.
module NotesWidget
class Form < MyWidget
responds_to_event :create, :with => :create_note
preserves_attr :display_mode, :from => '..'
def form # The form to add notes
@note = Notes.new()
render
end
#pragma mark -
#pragma mark The triggered actions
def create_note
@note = Notes.new(param(:note))
if @note.save
trigger :content_changed # DISCUSS: Notify the 'content' widget to update
#self.invoke(:form)
update :text => invoke(:form)
else
update :view => :form # dunno the difference
end
end
end
end
@Orion98MC
Copy link

You suck :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment