Skip to content

[question] The purpose of replacing methods with html(block_name) #25

Description

@blelump

Hi @fran-worley !

I wonder what was the reason of introducing html_blocks instead of using methods. Blocks are flexible for sure, but if you want to override a block, you have to either copy/paste the whole block from superclass and add additional logic, or use rename_html_context , e.g:

      rename_html_context(:input_column, :default_input_column)

      html(:input_column) do |input|
        concat 'blah'
        concat input.to_html(context: :default_input_column)
      end

In my opinion, both of these methods above arent such convenient as using simply:

  # class A
  def input_column

  end

  # class B
  def input_column
    concat 'blah'
    super
  end

Perhaps I'm missing something? So far, when I'm dealing with input_column or input_label, most cases cover prepending or appending some content into that blocks, because Bootstrap builder is well prepared 👍 .

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions