RailsCasts Pro episodes are now free!

Learn more or hide this

Br's Profile

GitHub User: brauliobo

Site: profiles.google.com/brauliobo

Comments by Br

Avatar

is there a way to delegate all instance variables of @template? for example, @controller, @action and others are not set within the scope of the presenter

I've got a solution but would like to have something better

ruby
def initialize(object, template)
  @object = object
  @template = template
  @template.instance_variables.each do |var|
    instance_variable_set var, @template.instance_variable_get(var)
  end
end