Hi, forst at all sorry if my english is not the best. I have a problem
with a form. I use REST routes, encuestas has_many preguntas and
preguntas belongs_to encuesta and has_many votados.
I want to show in a form all the respuestas in one encuesta. I tried
with this


<%form_for [...@encuesta, @preguntas] do |f|%>
 hola
<%- end -%>

But it doesn´t work. This is the error:

 RuntimeError in Encuestas#show

Showing encuestas/show.html.erb where line #10 raised:

Called id for nil, which would mistakenly be 4 -- if you really wanted
the id of nil, use object_id

Extracted source (around line #10):

7:   <b>Permalink:</b>
8:   <%=h @encuesta.permalink %>
9: </p>
10:   <%form_for [...@encuesta, @preguntas] do |f|%>
11:
12:    hola
13:

-------------------

If i try with something like this:
<%for pregunta in @encuesta.preguntas %>
hello
<%end%>
I can see hello so many times like preguntas are in encuesta. But i need
a form_for.

Anybody can help me please?
-- 
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to