if statement - problems with if condition in rails -
i tried render file if true.
my code
<% if @orbituarysite.notice_display.nil? %> <%= render 'notice_displays/form' , :remote => true %> <% end %>
i tried in console shows true, output
1.9.3-p194 :024 > b=orbituarysite.find(1) 1.9.3-p194 :025 > b.notice_display noticedisplay load (1.4ms) select "notice_displays".* "notice_displays" "notice_displays"."orbituarysite_id" = 1 limit 1 => nil 1.9.3-p194 :026 > b.notice_display.nil? => true
here shows true , i'm unable render form, though have value true please tell me missing?
you have make :-
<% if @orbituarysite.notice_display.nil? %> <%= render 'notice_displays/form' %> <% end %>
in notice_displays/_form
<%=form_for....., :remote => true%>
Comments
Post a Comment