Replacing Rails' default form builder with a custom form builder is a typical way of adding custom form helpers to a Rails application.
The typical way of doing this is:
ActionView::Base.default_form_builder = MyCustomFormBuilder
CREATE EXTENSION IF NOT EXISTS pgcrypto WITH SCHEMA public; | |
-- ---------------------------- | |
-- Table structure for events | |
-- ---------------------------- | |
DROP TABLE IF EXISTS "public"."events"; | |
CREATE TABLE "public"."events" ( | |
"id" uuid DEFAULT gen_random_uuid() NOT NULL, | |
"type" varchar NOT NULL COLLATE "default", | |
"stream" varchar NOT NULL COLLATE "default", |
Replacing Rails' default form builder with a custom form builder is a typical way of adding custom form helpers to a Rails application.
The typical way of doing this is:
ActionView::Base.default_form_builder = MyCustomFormBuilder
def submit_button(options={}) | |
text = options.delete(:text) || "Submit" | |
options.merge! :type => :submit | |
capture_haml do | |
haml_concat(content_tag(:button, options) do | |
haml_concat content_tag(:span, text) | |
end) | |
end | |
end |
module Events | |
class Opened | |
include Messaging::Message | |
attribute :account_id, String | |
attribute :customer_id, String | |
attribute :time, String | |
end | |
class Deposited |
{ | |
"title": "Event stream '$ce-sendFunds'", | |
"id": "http://127.0.0.1:2113/streams/%24ce-sendFunds", | |
"updated": "2016-04-13T23:27:54.854508Z", | |
"streamId": "$ce-sendFunds", | |
"author": { | |
"name": "EventStore" | |
}, | |
"headOfStream": true, | |
"selfUrl": "http://127.0.0.1:2113/streams/%24ce-sendFunds", |
module Events | |
class Recorded | |
include EventStore::Messaging::Message | |
include Lapse | |
attribute :error_id | |
attribute :time | |
attribute :source | |
attribute :hostname | |
attribute :error |
require 'benchmark' | |
class Thing | |
end | |
module SomeMod | |
end | |
Benchmark.bm do |x| | |
x.report do |
module Calculate | |
attr_accessor :num1 | |
attr_accessor :num2 | |
def calculate | |
self.! | |
end | |
end | |
class Arithmetic < Module |