Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

render() without arguments renders the last rendered state instead of the one it's called from #130

Open
cameel opened this issue Jul 29, 2012 · 0 comments

Comments

@cameel
Copy link
Contributor

cameel commented Jul 29, 2012

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant