cells icon indicating copy to clipboard operation
cells copied to clipboard

Possible Bug

Open neboduus opened this issue 7 years ago • 1 comments

I don't know if is a bug but I have the following Cell

class SchedulesCell < Cell::ViewModel
  def show
    render
  end

  def daily
    render
  end

  def weekly
    render
  end

  def planning
    model
  end

end

So I have anothers 2 cell's partials called daily abd weekly In my show.erb I have

<% case planning.activity.a_type %>
<% when '0' %>
    <%= daily %>
<% else %>
    <%= weekly %>
<% end %>

and in daily.erb and weekly.erb I have pure text.

Very simple isn't it? But it doesn't work. It gaves me

undefined method `[]' for nil:NilClass

If I use if instead of case it works. Am I missing something or there is a bug?

neboduus avatar Oct 13 '17 11:10 neboduus

Try to use case statement like described here:

<% case planning.activity.a_type
   when '0' %>
     <%= daily %>
<% else %>
     <%= weekly %>
<% end %>

jarosluv avatar Oct 31 '17 18:10 jarosluv