In my logs I can see that end_form_tag is being deprecated. I wanted to
make the switch now but cannot get the new end tag to work.
THIS WORKS:
<%= form_remote_tag :url =>{:action => "next_question",
:kwiz_id => @kwiz.id,
:position => @next_position} %>
<% @question.choices.each do |choice| -%>
<%= radio_button_tag "choice_id", choice.id %>
<%= choice.name %><br />
<% end -%>
<br />
<%= submit_tag "Next Question" %>
<%= end_form_tag %>
THIS DOES NOT WORK:
<%= form_remote_tag :url =>{:action => "next_question",
:kwiz_id => @kwiz.id,
:position => @next_position} %>
<% @question.choices.each do |choice| -%>
<%= radio_button_tag "choice_id", choice.id %>
<%= choice.name %><br />
<% end -%>
<br />
<%= submit_tag "Next Question" %>
<%= end %>
--
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
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---
Remove the = it isn''t supposed to write out end, only close the loop, thus you want <% end %> instead of <%= end %> On Apr 3, 2007, at 12:12 PM, Arch Stanton wrote:> > In my logs I can see that end_form_tag is being deprecated. I > wanted to > make the switch now but cannot get the new end tag to work. > > THIS WORKS: > > <%= form_remote_tag :url =>{:action => "next_question", > :kwiz_id => @kwiz.id, > :position => @next_position} %> > > <% @question.choices.each do |choice| -%> > <%= radio_button_tag "choice_id", choice.id %> > <%= choice.name %><br /> > <% end -%> > <br /> > <%= submit_tag "Next Question" %> > <%= end_form_tag %> > > > THIS DOES NOT WORK: > > <%= form_remote_tag :url =>{:action => "next_question", > :kwiz_id => @kwiz.id, > :position => @next_position} %> > > <% @question.choices.each do |choice| -%> > <%= radio_button_tag "choice_id", choice.id %> > <%= choice.name %><br /> > <% end -%> > <br /> > <%= submit_tag "Next Question" %> > <%= end %> > > -- > 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Niels Meersschaert wrote:> Remove the = it isn''t supposed to write out end, only close the loop, > thus you want > > <% end %> instead of <%= end %>That doesn''t work either :( -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
<% form_remote_tag :url =>{:action => "next_question"} do
%>
# Form contents...
<% end %>
Form tag helpers should not use <%= %> if you''re trying to pass
them a
block. They should use <% %>.
Alternatively, you could use:
<%= form_remote_tag :url =>{:action => "next_question"} %>
# Form contents...
</form>
But that''s not as pretty. See DHH''s article on the topic:
http://www.loudthinking.com/arc/2006_10.html
See also the following for examples of the syntax:
http://api.rubyonrails.org/classes/ActionView/Helpers/FormTagHelper.html#M000601
Hope this helps.
-PJ
--~--~---------~--~----~------------~-------~--~----~
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
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---