I''m playing around with Markaby and I decided to write a little blog app. I''m running into issues with forms however. If I use form_for the output of the form gets swallowed. For example: form_for :article, @article do |f| f.text_field :title f.check_box :published f.text_area :description f.text_field :pub_date f.text_area :content end gets rendered as an empty form tag. The above code of course works fine in an rhtml file (with appropriate erb tags). Oddly form_tag works fine in Markaby: form_tag :action => ''create'' text_field ''article'', ''title'' check_box ''article'', ''published'' text_area ''article'', ''description'' text_field ''article'', ''pub_date'' text_area ''article'', ''content'' end_form_tag Renders the form just fine. Anyone have thoughts on why this would be? I really like Markaby, and I also prefer the form_for syntax, so ideally I would like to use both. Any help would be appreciated. -- Larry Wright http://www.approachingnormal.com http://www.welcometoparenthood.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060802/5a54d83e/attachment.html
I''m playing around with Markaby and I decided to write a little blog app. I''m running into issues with forms however. If I use form_for the output of the form gets swallowed. For example: form_for :article, @article do |f| f.text_field :title f.check_box :published f.text_area :description f.text_field :pub_date f.text_area :content end gets rendered as an empty form tag. The above code of course works fine in an rhtml file (with appropriate erb tags). Oddly form_tag works fine in Markaby: form_tag :action => ''create'' text_field ''article'', ''title'' check_box ''article'', ''published'' text_area ''article'', ''description'' text_field ''article'', ''pub_date'' text_area ''article'', ''content'' end_form_tag Renders the form just fine. Anyone have thoughts on why this would be? I really like Markaby, and I also prefer the form_for syntax, so ideally I would like to use both. Any help would be appreciated. -- Larry Wright http://www.approachingnormal.com http://www.welcometoparenthood.com -- Posted via http://www.ruby-forum.com/.
try using @helpers.form_for and see what happens. Also, you might put parens around the arguments just for kicks. On Aug 2, 2006, at 7:47 AM, Larry Wright wrote:> I''m playing around with Markaby and I decided to write a little blog > app. I''m running into issues with forms however. If I use form_for the > output of the form gets swallowed. For example: > > form_for :article, @article do |f| > f.text_field :title > f.check_box :published > f.text_area :description > f.text_field :pub_date > f.text_area :content > end > > gets rendered as an empty form tag. The above code of course works > fine > in an rhtml file (with appropriate erb tags). Oddly form_tag works > fine > in Markaby: > > form_tag :action => ''create'' > text_field ''article'', ''title'' > check_box ''article'', ''published'' > text_area ''article'', ''description'' > text_field ''article'', ''pub_date'' > text_area ''article'', ''content'' > > end_form_tag > > Renders the form just fine. > > Anyone have thoughts on why this would be? I really like Markaby, > and I > also prefer the form_for syntax, so ideally I would like to use both. > Any help would be appreciated. > -- > Larry Wright > http://www.approachingnormal.com > http://www.welcometoparenthood.com > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails
On 8/2/06, Jamie Orchard-Hays <jamie@dang.com> wrote:> > try using @helpers.form_for and see what happens. Also, you might put > parens around the arguments just for kicks. > >No dice. I may just resort to using rhtml for my form partials and doing the rest in Markaby. -- Larry Wright http://www.approachingnormal.com http://www.welcometoparenthood.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060802/892f1454/attachment.html
Perhaps there is a bug in form_for? Or perhaps in Markaby? On Aug 2, 2006, at 1:41 PM, Larry Wright wrote:> On 8/2/06, Jamie Orchard-Hays <jamie@dang.com> wrote: > try using @helpers.form_for and see what happens. Also, you might put > parens around the arguments just for kicks. > > > No dice. I may just resort to using rhtml for my form partials and > doing the rest in Markaby. > -- > Larry Wright > http://www.approachingnormal.com > http://www.welcometoparenthood.com > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails
Jamie Orchard-hays wrote:> Perhaps there is a bug in form_for? Or perhaps in Markaby?You need to output the fields like this: form_for :article, @article do |f| self << f.text_field :title self << f.check_box :published self << f.text_area :description self << f.text_field :pub_date self << f.text_area :content end Alternative, you may be able to wrap the collection of fields in a div, but I haven''t tested that. -- Posted via http://www.ruby-forum.com/.
Chris Scharf wrote:> Alternative, you may be able to wrap the collection of fields in a div, > but I haven''t tested that.The div wrapper seems to work (at least with form_tag blocks, haven''t tried form_for though), for example: form_tag({:action => ''login''}, {:name => ''login''}) do div do : : end 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 -~----------~----~----~----~------~----~------~--~---
Stuart Rackham wrote:> The div wrapper seems to work (at least with form_tag blocks, haven''t > tried form_for though), for example:I posted a more detailed explanation and workarounds to http://code.whytheluckystiff.net/markaby/ticket/52 -- 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 -~----------~----~----~----~------~----~------~--~---