I want to drop deprecated code as per: start_form_tag and end_form_tag Use form_tag with a block. http://www.rubyonrails.org/deprecation However, I''m not sure how to do a block from the rhtml file. Somewhere I need curly braces for a block? Or, does it mean an "end" statement? The embedded part is throwing me off a bit. thufir@arrakis ~/strawr $ thufir@arrakis ~/strawr $ cat app/views/feeds/show.rhtml -n | head -n 53 | tail -n 18 36 37 <% @unused_tags 38 Tag.find(:all) - @feed.tags %> 39 40 <% if @unused_tags.any? %> 41 42 <%= form_tag :action => "add_some_tags", 43 :id => @feed %> 44 <b>Add a tag:</b><br> 45 <% @unused_tags.each {|tag| %> 46 <%= check_box(''tag''+tag.id.to_s, ''checked'') + 47 tag.tag %><br/> 48 <% } %> 49 <%= submit_tag %> 50 <%= end_form_tag %> 51 <% end %><p> 52 53 thufir@arrakis ~/strawr $ http://code.google.com/p/strawr/source thanks, Thufir --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On 23 Jan 2008, at 11:10, Thufir wrote:> > I want to drop deprecated code as per: > > start_form_tag and end_form_tag > Use form_tag with a block. > http://www.rubyonrails.org/deprecation > > However, I''m not sure how to do a block from the rhtml file. > Somewhere I > need curly braces for a block? Or, does it mean an "end" > statement? The > embedded part is throwing me off a bit. ><% form_tag :action => ''foo'' do %> bla bla bla <% end %>> thufir@arrakis ~/strawr $ > thufir@arrakis ~/strawr $ cat app/views/feeds/show.rhtml -n | head - > n 53 > | tail -n 18 > 36 > 37 <% @unused_tags > 38 Tag.find(:all) - @feed.tags %> > 39 > 40 <% if @unused_tags.any? %> > 41 > 42 <%= form_tag :action => "add_some_tags", > 43 :id => @feed %> > 44 <b>Add a tag:</b><br> > 45 <% @unused_tags.each {|tag| %> > 46 <%= check_box(''tag''+tag.id.to_s, ''checked'') + > 47 tag.tag %><br/> > 48 <% } %> > 49 <%= submit_tag %> > 50 <%= end_form_tag %> > 51 <% end %><p> > 52 > 53 > thufir@arrakis ~/strawr $ > > http://code.google.com/p/strawr/source > > > > thanks, > > Thufir > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On Wed, 23 Jan 2008 11:37:17 +0000, Frederick Cheung wrote:> <% form_tag :action => ''foo'' do %> > bla bla bla > <% end %>Following this (and trying to follow the API) results in: SyntaxError in Feeds#show Showing app/views/feeds/show.rhtml where line #43 raised: compile error /home/thufir/strawr/app/views/feeds/show.rhtml:43: syntax error, unexpected '')'' _erbout.concat " "; _erbout.concat(( form_tag :action => "add_some_tags", :id => @feed.id do ).to_s); _erbout.concat "\n" ^ /home/thufir/strawr/app/views/feeds/show.rhtml:50: syntax error, unexpected kEND, expecting '')'' end ; _erbout.concat "<p>\n" ^ /home/thufir/strawr/app/views/feeds/show.rhtml:57: syntax error, unexpected kEND, expecting '')'' Extracted source (around line #43): 40: Tag.find(:all) - @feed.tags %> 41: 42: <% if @unused_tags.any? %> 43: <%= form_tag :action => "add_some_tags", :id => @feed.id do %> 44: <b>Add a tag:</b><br> 45: <% @unused_tags.each {|tag| %> 46: <%= check_box(''tag''+tag.id.to_s, ''checked'') + tag.tag %><br/> If line 44 is syntactically correct (which I think it is, then perhaps the source of the error message lies in line 46, converting tag.id.to_s ,or maybe there''s a missing "end" (but that part looked ok to me). for source code: http://code.google.com/p/strawr/source and http://strawr.googlecode.com/svn/trunk/app/views/feeds/show.rhtml thanks, Thufir --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On 24 Jan 2008, at 09:01, Thufir wrote:> > On Wed, 23 Jan 2008 11:37:17 +0000, Frederick Cheung wrote: > > >> <% form_tag :action => ''foo'' do %> >> bla bla bla >> <% end %> > > Following this (and trying to follow the API) results in: >Well you haven''t done that. you''ve used <%=, whereas I used <% Fred> > SyntaxError in Feeds#show > > Showing app/views/feeds/show.rhtml where line #43 raised: > > compile error > /home/thufir/strawr/app/views/feeds/show.rhtml:43: syntax error, > unexpected '')'' > _erbout.concat " "; _erbout.concat(( form_tag :action => > "add_some_tags", :id => @feed.id do ).to_s); _erbout.concat "\n" > > ^ > /home/thufir/strawr/app/views/feeds/show.rhtml:50: syntax error, > unexpected kEND, expecting '')'' > end ; _erbout.concat "<p>\n" > ^ > /home/thufir/strawr/app/views/feeds/show.rhtml:57: syntax error, > unexpected kEND, expecting '')'' > > Extracted source (around line #43): > > 40: Tag.find(:all) - @feed.tags %> > 41: > 42: <% if @unused_tags.any? %> > 43: <%= form_tag :action => "add_some_tags", :id => @feed.id do %> > 44: <b>Add a tag:</b><br> > 45: <% @unused_tags.each {|tag| %> > 46: <%= check_box(''tag''+tag.id.to_s, ''checked'') + tag.tag > %><br/> > > > > If line 44 is syntactically correct (which I think it is, then perhaps > the source of the error message lies in line 46, converting > tag.id.to_s ,or maybe there''s a missing "end" (but that part looked > ok to > me). > > > for source code: > > http://code.google.com/p/strawr/source > and > http://strawr.googlecode.com/svn/trunk/app/views/feeds/show.rhtml > > > > thanks, > > Thufir > > > > --~--~---------~--~----~------------~-------~--~----~ > 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 > -~----------~----~----~----~------~----~------~--~--- >
I stand corrected! Thanks :) -Thufir --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---