Skip to content
This repository was archived by the owner on Oct 19, 2018. It is now read-only.
This repository was archived by the owner on Oct 19, 2018. It is now read-only.

Generate and inherit from ApplicationComponent #227

Open
@sfcgeorge

Description

@sfcgeorge

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions