app/views/category/new.erb
In this file , i have two line like this
<!-- <p><label for="book_subject">Subject</label>: -->
<!-- <%= collection_select(:book,:subject_id,@subjects,:id,:name) %></p>
-->
But, if these two lines are present , i get an error saying
"you have an unexpected nil error"
----------------------------
here is the full file:
app/views/category# more new*
<h1>Add new Category </h1>
<%= form_tag :action => 'create'%>
<p><label for="category_title">Category Title</label>:
<%= text_field 'category', 'category_title' %></p>
<p><label for="categoy_short_desc">Category Short Description</label>:
<%= text_field 'category', 'category_short_desc' %></p>
<p><label for="categoy_long_desc">Category Long Description</label>:
<%= text_area 'category', 'category_long_desc' %></p>
<!-- <p><label for="book_subject">Subject</label>: -->
<!-- <%= collection_select(:book,:subject_id,@subjects,:id,:name) %></p>
-->
<%= submit_tag "Create" %>
<%= form_tag %>
<%= link_to 'Back', {:action => 'list'} %>
-----------------------
If i remove these two lines
<!-- <p><label for="book_subject">Subject</label>: -->
<!-- <%= collection_select(:book,:subject_id,@subjects,:id,:name) %></p>
-->
then new.erb works fine.
Why so?
Why can't comment these two lines?
I'm sure there is some problem. But, i couldn't see what it is.
please let me know if u could what the problem is in cmmenting these two
lines.
thanks,
radha
--
Posted viahttp://www.ruby-forum.com/.