Similar to Rails by default generating an ApplicationModel < ActiveRecord::Base class which all AR generated classes inherit from User < ApplicationModel; we should generate an ApplicationComponent class and the component generator should generate components inheriting from that. E.g.
class ApplicationComponent < Hyperloop::Component
end
And then a component:
class Greeter < ApplicationComponent
render do
"Hello, World!"
end
end
This way you can add useful methods to your app's ApplicationComponent without monkeypatching Hyperloop or messing around with mixins.
I've just set up this structure in our app and it works great.
Similar to Rails by default generating an
ApplicationModel < ActiveRecord::Baseclass which all AR generated classes inherit fromUser < ApplicationModel; we should generate anApplicationComponentclass and the component generator should generate components inheriting from that. E.g.And then a component:
This way you can add useful methods to your app's ApplicationComponent without monkeypatching Hyperloop or messing around with mixins.
I've just set up this structure in our app and it works great.