My goal is to fill an html table in a view (schedule.html.haml):
- if @plans != nil
%p display this if plans is not null
- if @plans == nil
%p= action_name
with the data from @plans
in a controller:
def schedule
@plans = Order.all
end
I am sure Order.all
returns data. Route file is:
get 'schedule', to: 'order_articles#schedule'
When I try to do this plans is null. The output is:
schedule
I tried to check if plans
is null
with the code in the view. What did I do wrong?