cells
cells copied to clipboard
render() without arguments renders the last rendered state instead of the one it's called from
When I render a cell state from within a different state of the same cell, Cells seems to remember the name of the state and uses it when I call render()
again. See an example:
# app/cells/a_cell.rb
class A < Cell::Rails
def foobar
foo = render :state => :foo
bar = render
return foo + bar
end
def foo
return render
end
end
-# app/cells/a/foobar.html.haml
bar
-# app/cells/a/foo.html.haml
foo
I'd expect the second render()
to be equivalent to render :view => :foobar
but it works like render :state => :foo
instead.
The call below returns "foo\nfoo\n" instead of "foo\nbar\n":
render_cell :a, :foobar