I am facing this strange problem with the following section of code
<% if (@more == -1) %>
<%= link_to_remote "More Posts", :html => {:id => 'more-link', :onClick => 'return false;'}%>
<% else %>
<%= link_to_remote "More Posts", :url => {:action => 'view' ,:id => @more.to_i + 1} , :html => {:id => 'more-link'} %>
<% end %>
Now when I use this code, I get the following error
You have a nil object when you didn't expect it!You might have expected an instance of ActiveRecord::Base.The error occurred while evaluating nil.[]
Also the error seems to be at this line.
<%= link_to_remote "More Posts", :html => {:id => 'more-link', :onClick => 'return false;'}%>
So cant really figure out why this is not working?