Class Markaby::Rails::RailsBuilder::FormHelperProxy

  1. lib/markaby/rails/rails_builder.rb
Parent: Object

This is used for the block variable given to form_for. Typically, an erb template looks as so:

<% form_for :foo do |f|
  <%= f.text_field :bar %>
<% end %>

form_for adds the form tag to the input stream, and assumes that later the user will append the tag to the input stream himself (in erb, this is done with the <%= %> tags).

We could do the following in Markaby:

form_for :foo do |f|
  text f.text_field(:bar)
end

But this is ugly. This is prettier:

form_for :foo do |f|
  f.text_field :bar
end

Methods

public class

  1. new

public instance

  1. respond_to?

Public class methods

new (view, proxied_object)
[show source]
    # File lib/markaby/rails/rails_builder.rb, line 56
56:         def initialize(view, proxied_object)
57:           @view           = view
58:           @proxied_object = proxied_object
59:         end

Public instance methods

respond_to? (sym, include_private = false)
[show source]
    # File lib/markaby/rails/rails_builder.rb, line 61
61:         def respond_to?(sym, include_private = false)
62:           @proxied_object.respond_to?(sym, include_private) || super
63:         end