jonleighton / focused_controller

MIT License
468 stars 27 forks source link

Instance variables not available in template #37

Open kosmodisk opened 9 years ago

kosmodisk commented 9 years ago

Instance variables set in call are not available in template.

module FooController
  class Bar < Action
    def call
      @foo = 'foofoo'
    end
  end
end

bar.html.erb

<%= @foo.inspect %>

Outputs 'nil'.

kosmodisk commented 9 years ago

Any comments/news on that?

nixme commented 8 years ago

I believe using instance variables to share data to the view is another "wart" / design decision that this project doesn't agree with and adds another boundary.

Use expose as explained in the README ?